Show TOC Start of Content Area

Function documentation Multi-Threading  Locate the document in its SAP Library structure

Use

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.

Note

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:

This graphic is explained in the accompanying text

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

 

End of Content Area