Some logging cleanup
MODIFY
javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/LoggingConfigurer.java
javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/LoggingConfigurer.java
@@ -27,15 +27,7 @@ final class LoggingConfigurer {
if (isDebugMode()) {
setSystemPropertyDefault(SIMPLE_LOGGER_DEFAULT_LOG_LEVEL_PROPERTY, "DEBUG");
- // suppress a couple of verbose ClassNotFoundException stack traces logged at debug level
- setSystemPropertyDefault(SIMPLE_LOGGER_PREFIX + "io.perfmark.PerfMark", "INFO");
- setSystemPropertyDefault(SIMPLE_LOGGER_PREFIX + "io.grpc.Context", "INFO");
- setSystemPropertyDefault(SIMPLE_LOGGER_PREFIX + "io.grpc.internal.ServerImplBuilder", "INFO");
- setSystemPropertyDefault(SIMPLE_LOGGER_PREFIX + "io.grpc.ManagedChannelRegistry", "INFO");
- setSystemPropertyDefault(
- SIMPLE_LOGGER_PREFIX + "io.netty.util.internal.NativeLibraryLoader", "INFO");
- setSystemPropertyDefault(
- SIMPLE_LOGGER_PREFIX + "io.grpc.internal.ManagedChannelImplBuilder", "INFO");
+ setSystemPropertyDefault(SIMPLE_LOGGER_PREFIX + "okhttp3.internal.http2", "INFO");
} else {
// by default muzzle warnings are turned off
setSystemPropertyDefault(SIMPLE_LOGGER_PREFIX + "muzzleMatcher", "OFF");

MODIFY
smoke-tests/src/test/java/io/opentelemetry/smoketest/LinuxTestContainerManager.java
smoke-tests/src/test/java/io/opentelemetry/smoketest/LinuxTestContainerManager.java
@@ -21,8 +21,8 @@ import org.testcontainers.utility.DockerImageName;
import org.testcontainers.utility.MountableFile;
public class LinuxTestContainerManager extends AbstractTestContainerManager {
- private static final Logger logger = LoggerFactory.getLogger(LinuxTestContainerManager.class);
private static final Logger backendLogger = LoggerFactory.getLogger("Backend");
+ private static final Logger appLogger = LoggerFactory.getLogger("App");
private final Network network = Network.newNetwork();
private GenericContainer<?> backend = null;
@@ -79,7 +79,7 @@ public class LinuxTestContainerManager extends AbstractTestContainerManager {
.withExposedPorts(TARGET_PORT)
.withNetwork(network)
.withLogConsumer(output)
- .withLogConsumer(new Slf4jLogConsumer(logger))
+ .withLogConsumer(new Slf4jLogConsumer(appLogger))
.withCopyFileToContainer(
MountableFile.forHostPath(agentPath), "/" + TARGET_AGENT_FILENAME)
.withEnv(getAgentEnvironment(jvmArgsEnvVarName))

MODIFY
smoke-tests/src/test/java/io/opentelemetry/smoketest/windows/WindowsTestContainerManager.java
smoke-tests/src/test/java/io/opentelemetry/smoketest/windows/WindowsTestContainerManager.java
@@ -53,6 +53,7 @@ import org.testcontainers.containers.output.OutputFrame;
public class WindowsTestContainerManager extends AbstractTestContainerManager {
private static final Logger logger = LoggerFactory.getLogger(WindowsTestContainerManager.class);
private static final Logger backendLogger = LoggerFactory.getLogger("Backend");
+ private static final Logger appLogger = LoggerFactory.getLogger("App");
private static final String NPIPE_URI = "npipe:////./pipe/docker_engine";
@@ -179,7 +180,7 @@ public class WindowsTestContainerManager extends AbstractTestContainerManager {
},
createTargetWaiter(waitStrategy),
/* inspect= */ true,
- logger);
+ appLogger);
return null;
}

ADD
smoke-tests/src/test/resources/logback-test.xml
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+
+ <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>
+ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+ </pattern>
+ </encoder>
+ </appender>
+ <appender name="backend" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>
+ %logger{36} - %msg%n
+ </pattern>
+ </encoder>
+ </appender>
+
+ <root level="INFO">
+ <appender-ref ref="console"/>
+ </root>
+
+ <logger name="org.testcontainers" level="WARN" />
+ <logger name="io.opentelemetry.testing.internal.armeria" level="WARN"/>
+
+ <logger name="Backend" level="debug" additivity="false">
+ <appender-ref ref="backend" />
+ </logger>
+
+ <logger name="App" level="debug" additivity="false">
+ <appender-ref ref="backend" />
+ </logger>
+
+</configuration>

DELETE
smoke-tests/src/test/resources/logback.xml
-<?xml version="1.0" encoding="UTF-8"?>
-<configuration>
-
- <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
- <layout class="ch.qos.logback.classic.PatternLayout">
- <Pattern>
- %d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n
- </Pattern>
- </layout>
- </appender>
-
- <root level="WARN">
- <appender-ref ref="console"/>
- </root>
-
- <logger name="io.opentelemetry" level="debug"/>
- <logger name="org.testcontainers" level="debug"/>
- <logger name="org.testcontainers.shaded" level="warn"/>
- <logger name="org.testcontainers.containers.output.WaitingConsumer" level="warn"/>
- <logger name="Collector" level="debug"/>
- <logger name="Backend" level="debug"/>
-
-</configuration>

MODIFY
testing-common/src/main/resources/logback.xml
testing-common/src/main/resources/logback.xml
<configuration>
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
- <layout class="ch.qos.logback.classic.PatternLayout">
- <Pattern>
+ <encoder>
+ <pattern>
%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
- </Pattern>
- </layout>
+ </pattern>
+ </encoder>
</appender>
<root level="INFO">

Some logging cleanup (#4734)