Remove Log4j2 entries from netty-common's reflection metadata #108
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Apache Log4j2 does not work in a native image and that will be the case until Log4j2 3.0 at the earliest. Furthermore, Netty's
InternalLoggerFactory
is written such that SLF4J is preferred. As such, it does not make sense for Netty to provide reflection metadata for Log4j2 – in must cases the code that tries to use Log4j2 won't be reached and when it is, Log4j2 will not be usable anyway.In addition to the reflection metadata for Log4j2 not being beneficial to Netty, it's also harmful when using JBoss Logging. The metadata is sufficient for JBoss Logging's attempt to use Log4j2 to reach the point where error-level logging of stack traces is performed before falling back to another logging framework. Without Netty's metadata for Log4j2, this fallback is performed silently as intended.
To address these problems, this PR removes the Apache Log4j2 entries from netty-common's reflection metadata.
Checklist before merging
I haven't added any new tests but the existing tests continue to pass with the reduced metadata.