[
https://issues.apache.org/jira/browse/LOG4J2-2649?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16897451#comment-16897451
]
Ralph Goers commented on LOG4J2-2649:
-------------------------------------
It is hard to find any meaning in your startup time numbers since we have no
idea what your programmatic configuration does. It would be helpful to be a
little more specific in pointing out the areas where reflection is a problem.
Many of the places we use reflection is to be able to run in various JDK
releases or vendors. For example, we have to detect whether the Sun Reflection
class is available. Some things may able to be cleaned up by creating Java 9+
specific versions of classes but we can't know until we check.
We were and are well aware of the ServiceLoader. Log4j 2 uses it is several
places, including for loading a logging implementation. If you are talking
about how plugins are loaded, in master all plugins are now all loaded with
help of the ServiceLoader. But the Log4j Plugin mechanism is far more complex
than ServiceLoader and trying to load each plugin directly with the
ServiceLoader would be a mess and be slow. By using the annotation processor to
collect plugin definitions loading them is much, much faster.
Creating your own SLF4J bindings is certainly one way to solve the problem.
Offering suggestions or patches is another. Just saying the code sucks doesn't
help anyone.
> Is Log4j2 considered to support successful static compilation under GraalVM?
> -----------------------------------------------------------------------------
>
> Key: LOG4J2-2649
> URL: https://issues.apache.org/jira/browse/LOG4J2-2649
> Project: Log4j 2
> Issue Type: New Feature
> Reporter: YangGuanchao
> Priority: Blocker
> Original Estimate: 168h
> Remaining Estimate: 168h
>
> Oracle released GraalVM [https://github.com/oracle/graal] to support the
> static compilation of Java applications to Native Image, which can increase
> the startup speed of Java by at least 10 times. In the cloud native field,
> this basic technology is believed to be in the near future. Will be supported
> by more and more vendors, such as the Spring/Spring Boot community has
> supported or plans to support the feature of GraalVM, see this issue:
> [https://github.com/spring-projects/spring-framework/search?q=Graalvm&type=Issues]
> can support static compilation, so it is recommended that Log4j2 also need
> to support static compilation as soon as possible, and can be compiled
> correctly under GraalVM.
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)