Skip to content

Commit

Permalink
Implement MDC auto-instrumentation for log4j1
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Rzeszutek committed Sep 17, 2020
1 parent 51082cb commit 695bc9d
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ public ElementMatcher<ClassLoader> classLoaderMatcher() {

@Override
public ElementMatcher<? super TypeDescription> typeMatcher() {
// need to match a class, not an interface (ContextDataProvider) - otherwise helper classes
// and resources are not injected
// we cannot use ContextDataProvider here because one of the classes that we inject implements
// this interface, causing the interface to be loaded while it's being transformed, which leads
// to duplicate class definition error after the interface is transformed and the triggering
// class loader tries to load it.
return named("org.apache.logging.log4j.core.impl.ThreadContextDataInjector");
}

Expand Down

0 comments on commit 695bc9d

Please sign in to comment.