diff --git a/javaagent-log-appender/build.gradle.kts b/javaagent-log-appender/build.gradle.kts index b4f347e0a..052e191ff 100644 --- a/javaagent-log-appender/build.gradle.kts +++ b/javaagent-log-appender/build.gradle.kts @@ -33,11 +33,7 @@ dependencies { implementation("io.opentelemetry:opentelemetry-api") implementation("io.opentelemetry.semconv:opentelemetry-semconv") - // OpenTelemetry log4j / logback appenders - implementation("io.opentelemetry.instrumentation:opentelemetry-log4j-appender-2.17") - implementation("io.opentelemetry.instrumentation:opentelemetry-logback-appender-1.0") - - // OpenTelemetry JavaAgent + // OpenTelemetry JavaAgent, this brings its own standalone log4j / logback appenders agent("io.opentelemetry.javaagent:opentelemetry-javaagent:2.8.0") } @@ -49,5 +45,15 @@ application { tasks.named("run") { doFirst { jvmArgs("-javaagent:${agent.singleFile}") + // log4j-appender properties + jvmArgs( + "-Dotel.instrumentation.log4j-appender.experimental.capture-map-message-attributes=true", + "-Dotel.instrumentation.log4j-appender.experimental-log-attributes=true" + ) + // logback-appender properties + jvmArgs( + "-Dotel.instrumentation.logback-appender.experimental-log-attributes=true", + "-Dotel.instrumentation.logback-appender.experimental.capture-key-value-pair-attributes=true" + ) } } diff --git a/javaagent-log-appender/src/main/resources/log4j2.xml b/javaagent-log-appender/src/main/resources/log4j2.xml index 3601b9844..8c91e02f0 100644 --- a/javaagent-log-appender/src/main/resources/log4j2.xml +++ b/javaagent-log-appender/src/main/resources/log4j2.xml @@ -1,15 +1,13 @@ - + - - - \ No newline at end of file + diff --git a/javaagent-log-appender/src/main/resources/logback.xml b/javaagent-log-appender/src/main/resources/logback.xml index a14aeb7fa..348cb1f1a 100644 --- a/javaagent-log-appender/src/main/resources/logback.xml +++ b/javaagent-log-appender/src/main/resources/logback.xml @@ -7,13 +7,7 @@ - - true - true - - - \ No newline at end of file +