Skip to content

Commit

Permalink
Don't wrap exceptions from logback appender (#8040)
Browse files Browse the repository at this point in the history
  • Loading branch information
laurit committed Mar 13, 2023
1 parent dedc4d3 commit 0ef4c0b
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import io.opentelemetry.api.trace.SpanContext;
import io.opentelemetry.context.Context;
import io.opentelemetry.instrumentation.logback.mdc.v1_0.internal.UnionMap;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Proxy;
import java.util.HashMap;
import java.util.Iterator;
Expand Down Expand Up @@ -92,7 +93,11 @@ public ILoggingEvent wrapEvent(ILoggingEvent event) {
} else if ("getLoggerContextVO".equals(method.getName())) {
return vo;
}
return method.invoke(event, args);
try {
return method.invoke(event, args);
} catch (InvocationTargetException exception) {
throw exception.getCause();
}
});
}

Expand Down

0 comments on commit 0ef4c0b

Please sign in to comment.