Show TOC

Background documentationMulti-Threading Locate this document in the navigation structure

 

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.

Note Note

Recall the configuration that can be done for TraceFormatter, where you can specify if the format pattern includes the thread ID or not.

End of the note.

A sample output in TraceFormatter:

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