Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-2604

Generate reflect-config.json for GraalVM during annotation processing

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Configurators
    • Labels:
      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

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                rpopma Remko Popma
              • Votes:
                3 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 20m
                  1h 20m