LuckysHorizon opened a new pull request, #4183:
URL: https://github.com/apache/logging-log4j2/pull/4183
This PR fixes a properties-configuration parsing compatibility issue
reported in #2791.
In `.properties` configs, `MarkerFilter` attributes `onMatch` / `onMismatch`
were treated with strict key matching in `PropertiesConfigurationBuilder`,
which could leave mis-cased keys (for example `onMisMatch`) unconsumed and
produce invalid attribute errors at runtime.
### What changed
1. `log4j-core`
- Updated `PropertiesConfigurationBuilder#createFilter(...)` to resolve
`onMatch` and `onMismatch` in a case-insensitive way before building the filter.
2. `log4j-core-test`
- Added regression config:
`log4j2-properties-markerfilter-miscase.properties`
- Added regression test:
`MarkerFilterPropertiesCaseTest`
- Test validates that configuration starts successfully with a mis-cased
`onMisMatch` property, preventing regression.
### Why
This restores expected compatibility for properties-based `MarkerFilter`
configuration and avoids startup/runtime errors caused by minor attribute
casing differences.
Fixes #2791.
How to verify this change (add to PR description or comment)
### How to verify
1. Use Java 17.
2. From repository root:
```bash ./mvnw -pl log4j-core-test -am
-Dtest=MarkerFilterPropertiesCaseTest test
3. Expected result:
• MarkerFilterPropertiesCaseTest passes.
• Configuration file with onMisMatch is accepted and configuration starts.
4. (Optional full validation)
--
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]