Optimize Instrumenter logging
MODIFY
dd-java-agent/agent-tooling/src/main/java/datadog/trace/agent/tooling/Instrumenter.java
dd-java-agent/agent-tooling/src/main/java/datadog/trace/agent/tooling/Instrumenter.java
@@ -128,15 +128,23 @@ public interface Instrumenter {
final List<Reference.Mismatch> mismatches =
muzzle.getMismatchedReferenceSources(classLoader);
if (mismatches.size() > 0) {
+ if (log.isDebugEnabled()) {
log.debug(
"Instrumentation muzzled: {} -- {} on {}",
instrumentationPrimaryName,
- getClass().getName(),
+ this.getClass().getName(),
classLoader);
- }
- for (final Reference.Mismatch mismatch : mismatches) {
+ for (Reference.Mismatch mismatch : mismatches) {
log.debug("-- {}", mismatch);
}
+ }
+ } else {
+ log.debug(
+ "Applying instrumentation: {} -- {} on {}",
+ instrumentationPrimaryName,
+ this.getClass().getName(),
+ classLoader);
+ }
return mismatches.size() == 0;
}
return true;

Optimize Instrumenter logging