Fix "class ch.qos.logback.classic.spi.ThrowableProxyVO cannot be cast to class ch.qos.logback.classic.spi.ThrowableProxy"#4206
Fix "class ch.qos.logback.classic.spi.ThrowableProxyVO cannot be cast to class ch.qos.logback.classic.spi.ThrowableProxy"#4206adinauer merged 6 commits intogetsentry:mainfrom donbeave:main
Conversation
… to class ch.qos.logback.classic.spi.ThrowableProxy" 15:44:34,110 |-ERROR in io.sentry.logback.SentryAppender[SENTRY_ORIGINAL] - Appender [SENTRY_ORIGINAL] failed to append. java.lang.ClassCastException: class ch.qos.logback.classic.spi.ThrowableProxyVO cannot be cast to class ch.qos.logback.classic.spi.ThrowableProxy (ch.qos.logback.classic.spi.ThrowableProxyVO and ch.qos.logback.classic.spi.ThrowableProxy are in unnamed module of loader 'app') at java.lang.ClassCastException: class ch.qos.logback.classic.spi.ThrowableProxyVO cannot be cast to class ch.qos.logback.classic.spi.ThrowableProxy (ch.qos.logback.classic.spi.ThrowableProxyVO and ch.qos.logback.classic.spi.ThrowableProxy are in unnamed module of loader 'app') at at io.sentry.logback.SentryAppender.createEvent(SentryAppender.java:113) at at io.sentry.logback.SentryAppender.append(SentryAppender.java:80) at at io.sentry.logback.SentryAppender.append(SentryAppender.java:41) at at ch.qos.logback.core.UnsynchronizedAppenderBase.doAppend(UnsynchronizedAppenderBase.java:85) at at ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:51) at at io.opentelemetry.instrumentation.logback.mdc.v1_0.OpenTelemetryAppender.append(OpenTelemetryAppender.java:111) at at io.opentelemetry.instrumentation.logback.mdc.v1_0.OpenTelemetryAppender.append(OpenTelemetryAppender.java:30) at at ch.qos.logback.core.UnsynchronizedAppenderBase.doAppend(UnsynchronizedAppenderBase.java:85) at at ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:51) at at ch.qos.logback.classic.Logger.appendLoopOnAppenders(Logger.java:272) at at ch.qos.logback.classic.Logger.callAppenders(Logger.java:259) at at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:426) at at ch.qos.logback.classic.Logger.filterAndLog_2(Logger.java:419) at at ch.qos.logback.classic.Logger.error(Logger.java:535) at at io.micronaut.runtime.Micronaut.handleStartupException(Micronaut.java:343) at at io.micronaut.runtime.Micronaut.start(Micronaut.java:173) at at io.micronaut.runtime.Micronaut.run(Micronaut.java:328) at at io.micronaut.runtime.Micronaut.run(Micronaut.java:314)
|
Thanks for the PR, will try to take a look soon. |
|
@donbeave do you think it would make sense to capture the Can you please also share how you get logback to create an event that uses |
This is where it wraps the original event with |
|
Do you have an example on how to set this up so it ends up sending |
<?xml version="1.0" encoding="UTF-8"?>
<included>
<appender name="SENTRY_ORIGINAL" class="io.sentry.logback.SentryAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>WARN</level>
</filter>
</appender>
<appender name="SENTRY" class="io.opentelemetry.instrumentation.logback.mdc.v1_0.OpenTelemetryAppender">
<appender-ref ref="SENTRY_ORIGINAL"/>
</appender>
</included> |
|
Thanks I'm able to reproduce now. |
| new ExceptionMechanismException( | ||
| mechanism, throwableInformation.getThrowable(), Thread.currentThread()); | ||
| event.setThrowable(mechanismException); | ||
| if (loggingEvent.getThrowableProxy() instanceof ThrowableProxy) { |
There was a problem hiding this comment.
There's nothing else we can do here. In case we can't cast to ThrowableProxy, we cannot access the Throwable meaning we can't report the exception to Sentry.
Thank you so much! |
📜 Description