You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Logback instrumentation crashes on Android since version 2.11.0, because Android doesn't support the reflection that was introduced in #12513. In particular the crash occurs during the class initialization of LoggingEventMapper, when it refers to java.lang.ClassValue, which is absent on Android below API level 34.
The LoggingEventMapper class should carefully check for the existence of the ClassValue class (just like it does in supportsLogstashMarkers() with other classes) and it should only try to instantiate ClassValue, if it is available. Otherwise it should continue without the Logstash functionality added in #12513.
Actual behavior
The LoggingEventMapper class crashes on Android during the class initialization:
java.lang.NoClassDefFoundError: Failed resolution of: Ljava/lang/ClassValue;
at io.opentelemetry.instrumentation.logback.appender.v1_0.internal.LoggingEventMapper.builder(LoggingEventMapper.java:105)
at io.opentelemetry.instrumentation.logback.appender.v1_0.OpenTelemetryAppender.start(OpenTelemetryAppender.java:82)
at ch.qos.logback.core.joran.action.AppenderAction.end(Unknown Source:13)
at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Unknown Source:23)
at ch.qos.logback.core.joran.spi.Interpreter.endElement(Unknown Source:34)
at ch.qos.logback.core.joran.spi.Interpreter.endElement(Unknown Source:11)
at ch.qos.logback.core.joran.spi.EventPlayer.play(Unknown Source:84)
at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(Unknown Source:16)
at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(Unknown Source:18)
at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(Unknown Source:8)
at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(Unknown Source:24)
at ch.qos.logback.classic.util.ContextInitializer.autoConfig(Unknown Source:32)
...
Caused by: java.lang.ClassNotFoundException: Didn't find class "java.lang.ClassValue" on path: DexPathList[[...]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:196)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
Javaagent or library instrumentation version
2.12.0
Environment
JDK: Android OS: Android (API level 29)
Additional context
I will submit a bugfix in the next days, if I have some free time.
The text was updated successfully, but these errors were encountered:
Describe the bug
The Logback instrumentation crashes on Android since version
2.11.0
, because Android doesn't support the reflection that was introduced in #12513. In particular the crash occurs during the class initialization ofLoggingEventMapper
, when it refers tojava.lang.ClassValue
, which is absent on Android below API level 34.opentelemetry-java-instrumentation/instrumentation/logback/logback-appender-1.0/library/src/main/java/io/opentelemetry/instrumentation/logback/appender/v1_0/internal/LoggingEventMapper.java
Lines 73 to 79 in 5b21872
Steps to reproduce
Configure Logback to use the OpenTelemetryAppender on Android:
logback.xml
And then initialize logback.
Expected behavior
The
LoggingEventMapper
class should carefully check for the existence of theClassValue
class (just like it does insupportsLogstashMarkers()
with other classes) and it should only try to instantiateClassValue
, if it is available. Otherwise it should continue without the Logstash functionality added in #12513.Actual behavior
The
LoggingEventMapper
class crashes on Android during the class initialization:Javaagent or library instrumentation version
2.12.0
Environment
JDK: Android
OS: Android (API level 29)
Additional context
I will submit a bugfix in the next days, if I have some free time.
The text was updated successfully, but these errors were encountered: