[ 
https://issues.apache.org/jira/browse/LOG4J2-3534?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17559347#comment-17559347
 ] 

ASF subversion and git services commented on LOG4J2-3534:
---------------------------------------------------------

Commit c2d049d947da1f650862437df036fea470ff2869 in logging-log4j2's branch 
refs/heads/dependabot/maven/org.apache.maven.plugins-maven-pdf-plugin-1.6.0 
from Yohei Ueki
[ https://gitbox.apache.org/repos/asf?p=logging-log4j2.git;h=c2d049d947 ]

[LOG4J2-3534] Fix LevelRangeFilterBuilder to align with log4j1's behavior (#924)

The current `LevelRangeFilterBuilder` does not take into account the inversion 
of the level scale between Log4j 1 and Log4j 2: a minimal Log4j 1 level 
corresponds to a maximal Log4j 2 level and vice versa.

> LevelRangeFilterBuilder loses compatibility with log4j1.
> --------------------------------------------------------
>
>                 Key: LOG4J2-3534
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-3534
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Log4j 1.2 bridge
>            Reporter: Yohei Ueki
>            Priority: Major
>             Fix For: 2.18.0
>
>
> [LevelRangeFilterBuilder|https://github.com/apache/logging-log4j2/blob/rel/2.17.2/log4j-1.2-api/src/main/java/org/apache/log4j/builders/filter/LevelRangeFilterBuilder.java]
>  enables us to use log4j2's LevelRangeFilter with log4j1's configuration file.
>  
> The class 
> - has obvious bug here: 
> https://github.com/apache/logging-log4j2/blob/rel/2.17.2/log4j-1.2-api/src/main/java/org/apache/log4j/builders/filter/LevelRangeFilterBuilder.java#L65
> - log4j1's and log4j2's LogLevel orders are inversed (LOG4J2-2315), so we 
> also need to fix here 
> https://github.com/apache/logging-log4j2/blob/rel/2.17.2/log4j-1.2-api/src/main/java/org/apache/log4j/builders/filter/LevelRangeFilterBuilder.java#L97-L98
>  
> - lost compatibility with log4j1 here: 
> https://github.com/apache/logging-log4j2/blob/rel/2.17.2/log4j-1.2-api/src/main/java/org/apache/log4j/builders/filter/LevelRangeFilterBuilder.java#L85-L86
> I investigated log4j1's behavior:
> https://github.com/yueki1993/logging-log4j1/commits/level-range-filter-test
>  
> I fixed the class, added UTs and am ready to submit PR:
> https://github.com/yueki1993/logging-log4j2/commits/fix-level-range-filter-builder



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to