fix: Add GraalVM reachability metadata for non-plugin class instantiations #3800
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.
The
GraalVmProcessor
currently only generates metadata for Log4j plugins, overlooking other reflection usages in Log4j Core. This change adds reachability metadata for additional reflection cases to improve compatibility with GraalVM native images.Fixed Cases
This PR addresses the following reflective instantiations:
Configuration
instantiation inDefaultConfigurationBuilder
: Fixes support for thelog4j2.properties
configuration format when running on GraalVM.BlockingQueue
instantiation in JSON Template Layout: Enables GraalVM compatibility. Note:MpmcArrayQueue
is not supported on GraalVM and must be fixed in the JCTools project.Known Limitations (Explicitly Ignored)
The following cases are not addressed in this PR:
log4j-1.2-api
: While GraalVM supports JMX, usage of Log4j 1.x’s JMX interface is likely minimal.MulticastDnsAdvertiser
: This feature is probably unused and could pose a security risk by advertising log file locations via mDNS.