0 / 0
Logging messages with custom ID, Java Integration Stage

Logging messages with custom IDs

If the Logger class is invoked at run time, the messages are logged to the Director client log. If the Logger class is invoked at design time, the messages are logged to the Connector Access Service log. At run time, you can log a message with the message ID that is defined in the Java™ Integration stage or log a message with a custom message ID that is defined in your Java code.

You can use the following methods of the Logger class in your Java code to log messages with custom message IDs to the Director client log:
  • setComponentID(String compID)
  • debug(int messageNumber, String message)
  • information(int messageNumber, String message)
  • warning(int messageNumber, String message)
For more information about the Logger class, see the Javadoc information for the Java Integration stage API.
In the following example an informational message Job completed successfully is logged with the message ID IIS-CONN-MYCONN-00123.
Logger.setComponentID("MYCONN");
Logger.information(123, "Job completed successfully"); 
Generative AI search and answer
These answers are generated by a large language model in watsonx.ai based on content from the product documentation. Learn more