Details
-
New Feature
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
See https://github.com/oracle/graal/issues/1209 and https://github.com/oracle/graal/issues/808
Currently log4j2 cannot be used in GraalVM native images because it uses reflection.
Graal SubstrateVM can deal with reflection when it’s clear to the AOT compiler what classes, methods and fields are reflected on. The log4j plugin mechanism is too dynamic for the automatic reflection analysis.
This can be solved by providing a reflect-config.json configuration file, which may be embedded in the jar under META-INF/native-image/some/path/.
The annotation processor is the natural place to generate this configuration file, so that applications that provide custom Log4j components will have the necessary META-INF/native-image/org/apache/logging/log4j/core/config/plugins/reflect-config.json to accompany their META-INF/org/apache/logging/log4j/core/config/plugins/Log4j2Plugins.dat file in their jar.
Attachments
Issue Links
- is related to
-
LOG4J2-2649 Is Log4j2 considered to support successful static compilation under GraalVM?
- Resolved
-
LOG4J2-2621 Create log4j-plugins module and use ServiceLoader to load plugins
- Closed
- links to