The SAP Logging API works successfully in a multi-threading environment. The thread ID is stored with the message and can be displayed or masked in the output.
Recall the configuration that can be done for TraceFormatter, where you can specify if the format pattern includes the thread ID or not.
A sample output in trace format:
Jan 01, 2001 10:10:00 PM com.sap.fooClass.fooMethod [Thread-0] Fatal: A fatal message Jan 01, 2001 10:10:00 PM com.sap.fooClass.fooMethod [Thread-1] Fatal: A fatal message Jan 01, 2001 10:10:00 PM com.sap.fooClass.fooMethod2 [Thread-1] Error: An error message Jan 01, 2001 10:10:00 PM com.sap.fooClass.fooMethod [Thread-2] Fatal: A fatal message Jan 01, 2001 10:10:00 PM com.sap.fooClass.fooMethod2 [Thread-0] Error: An error message Jan 01, 2001 10:10:00 PM com.sap.fooClass.fooMethod2 [Thread-2] Error: An error message |