-
-
Notifications
You must be signed in to change notification settings - Fork 465
Fix "class ch.qos.logback.classic.spi.ThrowableProxyVO cannot be cast to class ch.qos.logback.classic.spi.ThrowableProxy" #4206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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. |
adinauer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @donbeave . I've added a test.
| new ExceptionMechanismException( | ||
| mechanism, throwableInformation.getThrowable(), Thread.currentThread()); | ||
| event.setThrowable(mechanismException); | ||
| if (loggingEvent.getThrowableProxy() instanceof ThrowableProxy) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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