You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2022/07/06 18:08:00 UTC

[jira] [Commented] (LOG4J2-3534) LevelRangeFilterBuilder loses compatibility with log4j1.

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

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

Commit c2d049d947da1f650862437df036fea470ff2869 in logging-log4j2's branch refs/heads/dependabot/maven/com.conversantmedia-disruptor-1.2.20 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.10#820010)