Show TOC Start of Content Area

Background documentation Assign Severity to a Source Locate the document in its SAP Library structure

Use the constants provided directly: Severity.DEBUG, Severity.PATH, Severity.INFO, Severity.WARNING, Severity.ERROR, Severity.FATAL, Severity.ALL, and Severity.NONE. For more information about the various severity level definitions, see Appendix A.

Normally, you assign a severity to the source using: loc.setEffectiveSeverity(Severity.INFO);. Any messages with severity lower than INFO will be discarded, others will be directed to the destination.

Introduce Concept of Hierarchical Severity

Assign severity to the parent, and its children will automatically inherit the assigned severity.

This graphic is explained in the accompanying text

static final Location loc = Location.getLocation(com.sap.fooPackage);

loc.setEffectiveSeverity(Severity.INFO);

 

If you have a location com.sap.fooPackage.Class1, it must have already inherited the severity INFO.

For more information about hierarchical severities, see Hierarchical Severity Inheritance.

Default with Strictest Severity

By default, the source object (assume the ascendants have not been assigned severity yet) has SEVERITY.NONE. Therefore, you can freely enable the output methods in the source code, but the actual logging is not activated until it is explicitly switched on when things are ready.

 

See also:

Specify an Output Destination

 

End of Content Area