Skip to content

Conversation

@yueki1993
Copy link
Contributor

@yueki1993 yueki1993 force-pushed the fix-level-range-filter-builder branch from 965b337 to 3981d69 Compare June 9, 2022 14:09
@yueki1993 yueki1993 marked this pull request as draft June 9, 2022 23:21
@yueki1993 yueki1993 marked this pull request as ready for review June 10, 2022 00:21
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;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was no warning in Log4j 1.x, so I wouldn't add it here. You can add a warning in the Log4j2 factory LevelRangeFilter#createFilter (using the StatusLogger).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I won't add warning log in Log4j2 factory too because if someone misconfigures LogLevelRangeFilter, no logs will be output - they should be able to notice misconfiguration easily.

Copy link
Contributor

@ppkarwasz ppkarwasz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yueki1993,

Thank You for your contribution. This looks good to me, just remember to add an entry in the src/changes/changes.xml file.

@yueki1993
Copy link
Contributor Author

Hello @ppkarwasz,
Thank you for your review. I pushed src/changes/changes.xml.
Is it better to squash my commits?

@ppkarwasz ppkarwasz merged commit c2d049d into apache:release-2.x Jun 13, 2022
@ppkarwasz
Copy link
Contributor

@yueki1993,
There is no need to squash the PR, since Github can do it automatically.

ppkarwasz pushed a commit to ppkarwasz/logging-log4j2 that referenced this pull request Jan 12, 2024
…vior (apache#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.
ppkarwasz pushed a commit to ppkarwasz/logging-log4j2 that referenced this pull request Jan 15, 2024
…vior (apache#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.
ppkarwasz pushed a commit to ppkarwasz/logging-log4j2 that referenced this pull request Jan 15, 2024
…vior (apache#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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants