Write an error, informational, or warning message to the log destination.
Syntax
void logError(String message) void logError(int messageNum) void logError(int messageNum, String param [,...]) void logError(int messageNum, Object[] paramArray)
void logInfo(String message) void logInfo(int messageNum) void logInfo(int messageNum, String param [,...]) void logInfo(int messageNum, Object[] paramArray)
void logWarning(String message) void logWarning(int messageNum) void logWarning(int messageNum, String param [,...]) void logWarning(int messageNum, Object[] paramArray)
Parameters
Notes
The logError(), logWarning(), and logInfo() methods send a message to the collaboration's log destination. By default, the log destination is the file InterchangeSystem.log. You can change the log destination by entering a value for the LOG_FILE parameter in the InterChange Server configuration file, InterchangeSystem.cfg. The parameter value can be a file name or STDOUT, which writes the log to InterChange Server's command window.
You can also set three other system configuration parameters related to logging. All parameters are located in the InterChange Server configuration file, InterchangeSystem.cfg.
For help in deciding whether to use the method that logs an informational, warning, or error message, refer to "Logging messages". The message text that appears in the user's log file is prefixed with the word Info, Warning, or Error, depending on the method you use to log the message.
Each of these logging methods has several forms:
All forms of the method that take a messageNum parameter require the use of a message file that is indexed by message number. For information on how to set up a message text file, refer to Creating a message file.
In addition to sending a message to the log destination, the logError() method also sends the error message to an email recipient if:
Examples
The following example logs an error message, using getString() to obtain an attribute's value in the message.
logError("Incorrect customer: CustomerID: " + fromCustomerBusObj.getString("CustomerID"));
The following example logs an error message whose text is contained in the collaboration's message file. The message, which is number 10 in the message file, takes two parameters: customer last name (LName attribute) and customer first name (FName attribute).
logError(10, customer.get("LName"), customer.get("FName");
The following example logs an error message using an array of parameters. For the purpose of illustration, the example uses an array with just two parameters. The example declares the array args, which has two elements, the customer ID and the customer name. The logError() method then logs an error, using message number 12 and the values in the args array.
Object[] args = { fromCustomerBusObj.getString("CustomerID"), fromCustomerBusObj.getString("CustomerName"); } logError(12, args);