[ 
https://issues.apache.org/jira/browse/LOG4J2-3534?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Yohei Ueki updated LOG4J2-3534:
-------------------------------
    Description: 
[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 
herehttps://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

  was:
[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
- 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


> 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
>
> [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 
> herehttps://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