Skip to content

Commit b4a73bf

Browse files
committed
fix
1 parent 6842b84 commit b4a73bf

File tree

1 file changed

+5
-11
lines changed
  • instrumentation/log4j/log4j-appender-2.17/testing/src/main/java/io/opentelemetry/instrumentation/log4j/appender/v2_17

1 file changed

+5
-11
lines changed

instrumentation/log4j/log4j-appender-2.17/testing/src/main/java/io/opentelemetry/instrumentation/log4j/appender/v2_17/AbstractLog4j2Test.java

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -266,17 +266,11 @@ protected static void performLogging(
266266
}
267267

268268
protected static List<AttributeAssertion> addCodeLocationAttributes(String methodName) {
269-
String selector = System.getProperty("Log4j2.contextSelector");
270-
boolean async = selector != null && selector.endsWith("AsyncLoggerContextSelector");
271-
if (async && !Boolean.getBoolean("testLatestDeps")) {
272-
// source info is not available by default when async logger is used in non latest dep tests
273-
return new ArrayList<>();
274-
}
275-
276-
List<AttributeAssertion> result = new ArrayList<>();
277-
result.addAll(codeFunctionAssertions(AbstractLog4j2Test.class, methodName));
278-
result.addAll(codeFileAndLineAssertions("AbstractLog4j2Test.java"));
279-
return result;
269+
// Code attributes are enabled in both javaagent and library test configurations
270+
List<AttributeAssertion> assertions = new ArrayList<>();
271+
assertions.addAll(codeFunctionAssertions(AbstractLog4j2Test.class, methodName));
272+
assertions.addAll(codeFileAndLineAssertions("AbstractLog4j2Test.java"));
273+
return assertions;
280274
}
281275

282276
@FunctionalInterface

0 commit comments

Comments
 (0)