Show TOC Start of Content Area

Background documentation Typical Practice for a Better Style  Locate the document in its SAP Library structure

Use

A good style of logging is recommended in the developing practice. Basically, you need to enable logging in two major steps – initialization and individual source classes.

Higher Level Versus Individual Level

Applications normally consist of different components and are deployed in a distributed environment. Typically, there has to be a common initialization routine for a component. Logging configuration, such as setting severity, can also be done at this stage..

A top-down approach is used, that is, defining a basic configuration at a higher level (component-oriented parent node). Most of the time you do not need to tune the logging behavior in such details for each class. In this case, a basic configuration at the top level is good enough to get the logging started. Only when specific setting has to be done individually for certain classes, you can enable that in the class level.

Class Level

In the individual class, it is recommended to have a static variable to hold the access to the location object (for better performance) and then start inserting messages:

This graphic is explained in the accompanying text

static Location _loc = Location.getLocation(<classname>.class);

_loc.infoT(… ….);

_loc.errorT(… ….);

 

More Information

Hierarchical Destination Inheritance

End of Content Area