Skip to content

Commit d6bc843

Browse files
committed
Address comment problems
1 parent 990dece commit d6bc843

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

instrumentation/jsp-2.3/javaagent/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ muzzle {
66
pass {
77
group.set("org.apache.tomcat")
88
module.set("tomcat-jasper")
9-
// version range [7.0.0,7.0.19) is missing from maven, can't add assertInverse
109
// tomcat 10 uses JSP 3.0
1110
versions.set("[7.0.19,10)")
1211
// version 8.0.9 depends on org.eclipse.jdt.core.compiler:ecj:4.4RC4 which does not exist
1312
skip("8.0.9")
13+
// can't add assertInverse.set(true)
14+
// Because when muzzle check within the range [7.0.0, 7.0.19), it appears that org.eclipse.jdt.core.compiler:ecj:xx does not exist.
1415
}
1516
}
1617

instrumentation/log4j/log4j-mdc-1.2/javaagent/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ muzzle {
88
module.set("log4j")
99
versions.set("[1.2,)")
1010
// version 1.2.15 has a bad dependency on javax.jms:jms:1.1 which was released as pom only
11-
skip("1.1.3", "1.2.15")
11+
skip("1.2.15")
1212
assertInverse.set(true)
1313
}
1414
}

instrumentation/log4j/log4j-mdc-1.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/log4j/mdc/v1_2/Log4j1InstrumentationModule.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,26 @@
55

66
package io.opentelemetry.javaagent.instrumentation.log4j.mdc.v1_2;
77

8+
import static io.opentelemetry.javaagent.extension.matcher.AgentElementMatchers.hasClassesNamed;
89
import static java.util.Arrays.asList;
910

1011
import com.google.auto.service.AutoService;
1112
import io.opentelemetry.javaagent.extension.instrumentation.InstrumentationModule;
1213
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
1314
import java.util.List;
15+
import net.bytebuddy.matcher.ElementMatcher;
1416

1517
@AutoService(InstrumentationModule.class)
1618
public class Log4j1InstrumentationModule extends InstrumentationModule {
1719
public Log4j1InstrumentationModule() {
1820
super("log4j-mdc", "log4j-mdc-1.2");
1921
}
2022

23+
@Override
24+
public ElementMatcher.Junction<ClassLoader> classLoaderMatcher() {
25+
return hasClassesNamed("org.apache.log4j.MDC");
26+
}
27+
2128
@Override
2229
public List<TypeInstrumentation> typeInstrumentations() {
2330
return asList(new CategoryInstrumentation(), new LoggingEventInstrumentation());

0 commit comments

Comments
 (0)