The table below presents the API used for setting the relative severity:
Setting Relative Severity
Regular |
Location |
Category |
Comment |
setEffectiveSeverity(int severity) |
setEffectiveSeverity(Category relative, int severity) |
setEffectiveSeverity(Location relative, int severity) |
|
setEffectiveSeverity() |
setEffectiveSeverity(Category relative) |
setEffectiveSeverity(Location relative) |
Reset severity (with respect to the relative) |
setMaximumSeverity(int severity) |
setMaximumSeverity(Category relative, int severity) |
setMaximumSeverity(Location relative, int severity) |
|
setMaximumSeverity() |
setMaximumSeverity(Category relative) |
setMaximumSeverity(Location relative) |
Reset |
setMinimumSeverity(int severity) |
setMinimumSeverity(Category relative, int severity) |
setMinimumSeverity(Location relative, int severity) |
|
setMinimumSeverity() |
setMinimumSeverity(Category relative) |
setMinimumSeverity(Location relative) |
Reset |
The relative severity is specific for each location-category pair. To change or reset the relative severity, the relative has to be clearly indicated in the API.
The relative severity is unidirectional:
loc1.setEffectiveSeverity(cat1, Severity.INFO);
Relative severity is also hereditary. Children also inherit the relative severity assignment. The same logic of local restriction through the use of maximum (ceiling) and minimum (floor) severity limit is also applicable to the children. For more information, see Hierarchical Severity Inheritance.
The evaluation is always done with respective to the relative(s).
The severity of a log controller can be different when a relative severity is set. The general rule is: the minimum severity of the two factors below has always priority:
· Direct severity of itself;
· Severity related to its relative;
· If multiple relatives exist, the minimum of the relative severities has priority;
This applies to all three types of severities shown in the table above: effective, maximum, and minimum. The following tables highlight the severity results both in cases of evaluating with and without a relative.
Regular: |
With
Relative: |
Result: |
Result: |
Comments |
FATAL |
<…not set…> |
FATAL |
FATAL |
|
<…not set…> |
INFO |
NONE |
INFO |
|
FATAL |
INFO |
FATAL |
INFO |
|
INFO |
ERROR |
INFO |
INFO |
Not stricter |
Regular: |
With
Relative: |
Result: |
Result: |
Comments |
FATAL |
<…nothing…> |
FATAL |
FATAL |
|
<…not set…> |
INFO |
NONE |
INFO |
|
FATAL |
INFO |
FATAL |
INFO |
|
INFO |
ERROR |
INFO |
INFO |
Not stricter |
Regular: |
With
Relative: |
Result: |
Result: |
Comments |
FATAL |
<…nothing…> |
FATAL |
FATAL |
|
<…not set…> |
INFO |
NONE |
INFO |
|
FATAL |
INFO |
FATAL |
INFO |
|
INFO |
ERROR |
INFO |
INFO |
Not stricter |
The use of relative severity is fairly independent. It never affects the individual severity evaluation of the log controller itself.
If you decide not to configure the output with respective to any relative, the relative severity assignment has no effect on the output. The result stays as listed in the third column.