Details
-
Documentation
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
2.8.2
-
None
Description
The defaultThreshold property is not honored as documented :
defaultThreshold Level of messages to be filtered. If there is no matching key in the key/value pairs then this level will be compared against the event's level.
after carefully examining the source code, I found the following code is called:
DynamicThresholdFilter.java
private Result filter(Level level, ReadOnlyStringMap contextMap) { String value = (String)contextMap.getValue(this.key); if(value != null) { Level ctxLevel = (Level)this.levelMap.get(value); if(ctxLevel == null) { ctxLevel = this.defaultThreshold; } return level.isMoreSpecificThan(ctxLevel)?this.onMatch:this.onMismatch; } else { return Result.NEUTRAL; } }
where level is the event's level, when there's no matching key found contextMap, Result.NEUTRAL is mistakenly returned, instead of against this.defaultThreshold.