From 5cacdbef48a16acfa6597e35450482166ace1415 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Mon, 14 Nov 2022 13:21:20 +0000 Subject: [PATCH] Remove Log4j2 entries from netty-common's reflection metadata MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Apache Log4j2 does not work in a native image and that will be the case until Log4j2 3.0 at the earliest [1]. 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. [1] https://issues.apache.org/jira/browse/LOG4J2-2649 --- .../4.1.80.Final/reflect-config.json | 57 ------------------- 1 file changed, 57 deletions(-) diff --git a/metadata/io.netty/netty-common/4.1.80.Final/reflect-config.json b/metadata/io.netty/netty-common/4.1.80.Final/reflect-config.json index ff958963..ed4930a4 100644 --- a/metadata/io.netty/netty-common/4.1.80.Final/reflect-config.json +++ b/metadata/io.netty/netty-common/4.1.80.Final/reflect-config.json @@ -4308,63 +4308,6 @@ }, "name": "org.apache.log4j.Priority" }, - { - "condition": { - "typeReachable": "io.netty.util.internal.logging.Log4J2Logger$1" - }, - "name": "org.apache.logging.log4j.Logger", - "queriedMethods": [ - { - "name": "debug", - "parameterTypes": [ - "java.lang.String", - "java.lang.Object" - ] - } - ] - }, - { - "condition": { - "typeReachable": "io.netty.util.internal.logging.Log4JLoggerFactory" - }, - "name": "org.apache.logging.log4j.core.LoggerContext" - }, - { - "condition": { - "typeReachable": "io.netty.util.internal.logging.Log4J2Logger" - }, - "name": "org.apache.logging.log4j.message.DefaultFlowMessageFactory", - "methods": [ - { - "name": "", - "parameterTypes": [] - } - ] - }, - { - "condition": { - "typeReachable": "io.netty.util.internal.logging.Log4JLoggerFactory" - }, - "name": "org.apache.logging.log4j.message.DefaultFlowMessageFactory", - "methods": [ - { - "name": "", - "parameterTypes": [] - } - ] - }, - { - "condition": { - "typeReachable": "io.netty.util.internal.logging.Log4JLoggerFactory" - }, - "name": "org.apache.logging.log4j.message.ReusableMessageFactory", - "methods": [ - { - "name": "", - "parameterTypes": [] - } - ] - }, { "condition": { "typeReachable": "io.netty.handler.ssl.util.BouncyCastleSelfSignedCertGenerator"