Sends an error, information, or warning message to the InterChange Server log file.
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
Return values
None.
Exceptions
None.
Notes
This method sends a message to the InterChange Server Express's logging destination. The logging destination can be a file, a window, or both.
By default, the logging destination is the file InterchangeSystem.log. You can change the logging destination by entering a value for the LOG_FILE parameter in the configuration file, InterchangeSystem.cfg. The parameter value can be a file name, STDOUT (which writes the log to the server's command window), or both.
Within each set of methods:
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 Appendix A, "Message files".
Examples
The following example logs an informational message, using getString() to obtain an attribute value to log in the message.
logInfo("Item shipped. CustomerID: " + fromCustomerBusObj.getString("CustomerID"));
The following example logs an error message whose text is contained in the map 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);
See also