Show TOC Start of Content Area

Background documentation Content of Trace Messages Locate the document in its SAP Library structure

Since trace messages are intended for persons with development skills, the developer knows best what he/she needs to know to understand the processing of the application. The types mentioned in the previous section are typical types of information, which must be traced. As a general rule, the trace has to contain a detailed identification of the executed code. Depending on the type of trace message, the following information must be provided:

·        Program flow messages

The name of the current execution unit (subroutine/method, class name, the package name is not necessary, since it is normally used as trace location) and the type of activity (entrance or leave of the execution unit) must be provided. In case of “abnormal” leaves or entrances of an execution unit (like it is with exceptions), details to the situation (like the exception name and information about the exception origin) have to be provided.

·        Program context trace messages

The Typical Types of Trace Messages section lists a couple of different known context trace message types. In general the information provided in these messages must help to quickly and briefly understand the program context. This can be the name and value of important variables. If the variables are of simple types, this may be easy to achieve. If a variable holds a complex object, it is normally not useful to insert a complete textual description of the object into the trace message, since this will flood the trace file with probably useless information and will make it difficult to read. A better idea is to include a brief description of the object (like an object ID or name and a selection of most important attributes). If it is really necessary to peek into any possible attribute of an object, tracing will not be the appropriate mechanism. A detailed examination has to be performed via debugging.

 

End of Content Area