logError
Writes an error message to the log.
Use the following syntax:
logError(String msg);
The following table describes the parameter:
Parameter | Parameter Type | Datatype | Description |
---|
msg | Input | String | Error message string. |
You can add the logError method to the Java code on any code entry tab except the Imports and Functions tabs.
The following Java code shows how to log an error when the input port is null:
// check BASE_SALARY
if (isNull("BASE_SALARY")) {
logError("Cannot process a null salary field.");
}
When the code runs, the following message appears in the log:
[JTX_1013] [ERROR] Cannot process a null salary field.