yueki1993 commented on code in PR #924:
URL: https://github.com/apache/logging-log4j2/pull/924#discussion_r894211536
##########
log4j-1.2-api/src/main/java/org/apache/log4j/builders/filter/LevelRangeFilterBuilder.java:
##########
@@ -83,19 +86,23 @@ public Filter parse(PropertiesConfiguration config) {
}
private Filter createFilter(String levelMax, String levelMin, boolean
acceptOnMatch) {
- Level max = Level.FATAL;
- Level min = Level.TRACE;
+ Level max = Level.OFF;
+ Level min = Level.ALL;
if (levelMax != null) {
- max = OptionConverter.toLevel(levelMax,
org.apache.log4j.Level.FATAL).getVersion2Level();
+ max = OptionConverter.toLevel(levelMax,
org.apache.log4j.Level.OFF).getVersion2Level();
}
if (levelMin != null) {
- min = OptionConverter.toLevel(levelMin,
org.apache.log4j.Level.DEBUG).getVersion2Level();
+ min = OptionConverter.toLevel(levelMin,
org.apache.log4j.Level.ALL).getVersion2Level();
}
org.apache.logging.log4j.core.Filter.Result onMatch = acceptOnMatch
? org.apache.logging.log4j.core.Filter.Result.ACCEPT
: org.apache.logging.log4j.core.Filter.Result.NEUTRAL;
Review Comment:
Is it better to output warning log if `max < min` here?
Current released implementation should work if we swap `levelMin` and
`levelMax` in `log4j.properties`.
This is degradation for people who configure log4j like that.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]