Show TOC Start of Content Area

Background documentation Output Resulting from Relative Severity Locate the document in its SAP Library structure

       1.      Use the table below to elaborate (effectiveSeverity). What will be the result of the following code for each of the conditions listed? The example below will produce log messages with respect to a location:

This graphic is explained in the accompanying text

Category cat = Category.getCategory("Objects/Management");

   Location loc = Location.getLocation("com.sapmarkets.xxx.a");

cat.warningT(loc, methodname, "Error registering object {0}.");

 

Regular:
cat.setEffectiveSeverity(<severity>)

With Relative:
cat.setEffectiveSeverity(loc, <severity>)

Result, output enabled(with relative ‘loc’)?
cat.warningT(loc, ….)

FATAL

<…not set…>

NO

<…not set…>

INFO

YES

FATAL

INFO

YES

INFO

ERROR

YES

 

       2.      Producing traces from a location with respect to a category:

This graphic is explained in the accompanying text

Category cat = Category.getCategory("Objects/Management");

   Location loc = Location.getLocation("com.sapmarkets.xxx.a");

 

loc.warningT(methodname, messageCode);

loc.warning(cat, methodname, messageCode);

 

Regular:
loc.setEffectiveSeverity
(<severity>)

With Relative:
loc.setEffectiveSeverity
(cat, <severity>)

Result, output enabled (without relative ‘cat’)?
loc.warningT( ………..)

Result, output enabled(with relative ‘cat’)?
loc.warning(cat, .…..)

FATAL

<…not set…>

NO

NO

<…not set…>

INFO

NO

YES

FATAL

INFO

NO

YES

INFO

ERROR

YES

YES

 

When the output methods API denote a relative (or relatives), the logging framework tries to output the message simultaneously to both the log controller and its relative(s). The evaluations are independent and done separately. The results shown in the tables above are those for the log controller itself.

Whether the output is enabled at the relative totally depends on the configuration set by the relative itself, which at the same time evaluates the severity with respective to the log controller. If no explicit relative severity is configured by the relative, the situation becomes similar to the conditions listed in the table below.

Regular:
cat.setEffectiveSeverity
(<severity>)

With Relative:
cat.setEffectiveSeverity
(loc, <severity>)

Output enabled for cat?
cat.warningT(loc, ….)

Output enabled
by relative ‘loc’?
(no explicit
severity setting)

FATAL

<…not set…>

NO

NO

<…not set…>

INFO

YES

NO

FATAL

INFO

YES

NO

INFO

ERROR

YES

NO

 

In case the relative severity is also specified at the relative loc (assuming its own severity remains the default Severity.NONE value), consider the following data:

Regular:
cat.setEffectiveSeverity
(<severity>)

With Relative:
cat.setEffectiveSeverity
(loc, <severity>)

At loc:
loc.setEffectiveSeverity
(cat, <severity>)

Output enabled by relative ‘loc’?

FATAL

<…not set…>

<…not set…>

NO

<…not set…>

INFO

INFO

YES

FATAL

INFO

WARNING

YES

INFO

ERROR

ERROR

NO

 

 

 

End of Content Area