The SAP Logging API works well in a multi-threading environment. The thread ID is stored with the message and can be displayed or masked in the output.
If you recall the configuration (for TraceFormatter), you can specify whether the pattern to include 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 |