[Bug] spring-boot-starter-log4j2 + spring-boot-starter-data-redis cause logs cannot be reported #12406
Unanswered
liufeng2311
asked this question in
Q&A
Replies: 1 comment
-
any update? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Search before asking
Apache SkyWalking Component
Java Agent (apache/skywalking-java)
What happened
The server is using version 9.4.0, and the Java agent is using version 8.16.0. The Spring Boot project is using log4j2 as the logging framework. When the spring-boot-starter-data-redis is introduced, the logs can no longer be reported. The specific configuration is as follows:
4.0.0
org.springframework.boot
spring-boot-starter-parent
3.3.1
com.liufeng.demo
skywalking-slf4j2
0.0.1-SNAPSHOT
skywalking-slf4j2
skywalking-slf4j2
<java.version>17</java.version>
org.springframework.boot
spring-boot-starter-web
org.springframework.boot
spring-boot-starter-logging
The error message is:
INFO 2024-07-02 20:16:20.866 main AgentClassLoader : /Users/liufeng/Downloads/skywalking-agent/activations/apm-toolkit-trace-activation-8.16.0.jar loaded.
INFO 2024-07-02 20:16:20.866 main AgentClassLoader : /Users/liufeng/Downloads/skywalking-agent/activations/apm-toolkit-micrometer-activation-8.16.0.jar loaded.
INFO 2024-07-02 20:16:20.866 main AgentClassLoader : /Users/liufeng/Downloads/skywalking-agent/activations/apm-toolkit-logging-common-8.16.0.jar loaded.
INFO 2024-07-02 20:16:20.866 main AgentClassLoader : /Users/liufeng/Downloads/skywalking-agent/activations/apm-toolkit-kafka-activation-8.16.0.jar loaded.
ERROR 2024-07-02 20:16:20.908 main SkyWalkingAgent : index=0, batch=[class org.apache.logging.log4j.core.impl.Log4jLogEvent, class org.apache.skywalking.apm.toolkit.log.log4j.v2.x.log.GRPCLogClientAppender, class org.apache.logging.log4j.core.async.AsyncLoggerConfig, class org.apache.logging.log4j.core.appender.AsyncAppender, class org.apache.skywalking.apm.toolkit.log.log4j.v2.x.TraceIdConverter, class org.apache.skywalking.apm.toolkit.log.log4j.v2.x.SkyWalkingContextConverter], types=[class org.apache.logging.log4j.core.impl.Log4jLogEvent, class org.apache.skywalking.apm.toolkit.log.log4j.v2.x.log.GRPCLogClientAppender, class org.apache.logging.log4j.core.async.AsyncLoggerConfig, class org.apache.logging.log4j.core.appender.AsyncAppender, class org.apache.skywalking.apm.toolkit.log.log4j.v2.x.TraceIdConverter, class org.apache.skywalking.apm.toolkit.log.log4j.v2.x.SkyWalkingContextConverter]
java.lang.UnsupportedOperationException: class redefinition failed: attempted to change superclass or interfaces
at java.instrument/sun.instrument.InstrumentationImpl.retransformClasses0(Native Method)
at java.instrument/sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:169)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.apache.skywalking.apm.dependencies.net.bytebuddy.utility.Invoker$Dispatcher.invoke(Unknown Source)
at org.apache.skywalking.apm.dependencies.net.bytebuddy.utility.dispatcher.JavaDispatcher$Dispatcher$ForNonStaticMethod.invoke(JavaDispatcher.java:1032)
at org.apache.skywalking.apm.dependencies.net.bytebuddy.utility.dispatcher.JavaDispatcher$ProxiedInvocationHandler.invoke(JavaDispatcher.java:1162)
at org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.$Proxy35.retransformClasses(Unknown Source)
at org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$RedefinitionStrategy$Collector$ForRetransformation.doApply(AgentBuilder.java:8177)
at org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$RedefinitionStrategy$Collector.apply(AgentBuilder.java:7992)
at org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$RedefinitionStrategy.apply(AgentBuilder.java:5689)
at org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$Default.doInstall(AgentBuilder.java:11126)
at org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$Default.installOn(AgentBuilder.java:11044)
at org.apache.skywalking.apm.agent.SkyWalkingAgent.premain(SkyWalkingAgent.java:136)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:491)
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:503)
What you expected to happen
I hope to start without any errors and logs can be reported normally.
How to reproduce
Adding the following configuration results in an error.
4.0.0
org.springframework.boot
spring-boot-starter-parent
3.3.1
com.liufeng.demo
skywalking-slf4j2
0.0.1-SNAPSHOT
skywalking-slf4j2
skywalking-slf4j2
<java.version>17</java.version>
org.springframework.boot
spring-boot-starter-web
org.springframework.boot
spring-boot-starter-logging
Anything else
product use kafka to report logs
Are you willing to submit a pull request to fix on your own?
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions