Split out log4j appender
MODIFY
instrumentation/log4j/log4j-2.13.2/library-autoconfigure/build.gradle.kts
instrumentation/log4j/log4j-2.13.2/library-autoconfigure/build.gradle.kts
@@ -3,8 +3,6 @@ plugins {
}
dependencies {
- compileOnly("io.opentelemetry:opentelemetry-sdk-logs")
-
library("org.apache.logging.log4j:log4j-core:2.13.2")
// Library instrumentation cannot be applied to 2.13.2 due to a bug in Log4J. The agent works
@@ -12,7 +10,4 @@ dependencies {
testLibrary("org.apache.logging.log4j:log4j-core:2.13.3")
testImplementation(project(":instrumentation:log4j:log4j-2-common:testing"))
- testImplementation("io.opentelemetry:opentelemetry-sdk-logs")
-
- testImplementation("org.mockito:mockito-core")
}

ADD
instrumentation/log4j/log4j-2.13.2/library/build.gradle.kts
+plugins {
+ id("otel.library-instrumentation")
+}
+
+dependencies {
+ compileOnly("io.opentelemetry:opentelemetry-sdk-logs")
+
+ library("org.apache.logging.log4j:log4j-core:2.13.2")
+
+ testImplementation("io.opentelemetry:opentelemetry-sdk-logs")
+
+ testImplementation("org.mockito:mockito-core")
+}

RENAME
instrumentation/log4j/log4j-2.13.2/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/log4j/v2_13_2/LogEventMapper.java
instrumentation/log4j/log4j-2.13.2/library/src/main/java/io/opentelemetry/instrumentation/log4j/v2_13_2/LogEventMapper.java
RENAME
instrumentation/log4j/log4j-2.13.2/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/log4j/v2_13_2/OpenTelemetryAppender.java
instrumentation/log4j/log4j-2.13.2/library/src/main/java/io/opentelemetry/instrumentation/log4j/v2_13_2/OpenTelemetryAppender.java
RENAME
instrumentation/log4j/log4j-2.13.2/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/log4j/v2_13_2/OpenTelemetryLog4j.java
instrumentation/log4j/log4j-2.13.2/library/src/main/java/io/opentelemetry/instrumentation/log4j/v2_13_2/OpenTelemetryLog4j.java
RENAME
instrumentation/log4j/log4j-2.13.2/library-autoconfigure/src/test/java/io/opentelemetry/instrumentation/log4j/v2_13_2/OpenTelemetryAppenderConfigTest.java
instrumentation/log4j/log4j-2.13.2/library/src/test/java/io/opentelemetry/instrumentation/log4j/v2_13_2/OpenTelemetryAppenderConfigTest.java
RENAME
instrumentation/log4j/log4j-2.13.2/library-autoconfigure/src/test/java/io/opentelemetry/instrumentation/log4j/v2_13_2/OpenTelemetryAppenderTest.java
instrumentation/log4j/log4j-2.13.2/library/src/test/java/io/opentelemetry/instrumentation/log4j/v2_13_2/OpenTelemetryAppenderTest.java
RENAME
instrumentation/log4j/log4j-2.13.2/library-autoconfigure/src/test/java/io/opentelemetry/instrumentation/log4j/v2_13_2/OpenTelemetryLog4jTest.java
instrumentation/log4j/log4j-2.13.2/library/src/test/java/io/opentelemetry/instrumentation/log4j/v2_13_2/OpenTelemetryLog4jTest.java
RENAME
instrumentation/log4j/log4j-2.13.2/library-autoconfigure/src/test/resources/log4j2-test.xml
instrumentation/log4j/log4j-2.13.2/library/src/test/resources/log4j2-test.xml
MODIFY
settings.gradle.kts
settings.gradle.kts
@@ -266,6 +266,7 @@ include(":instrumentation:liberty:liberty-dispatcher:javaagent")
include(":instrumentation:log4j:log4j-1.2:javaagent")
include(":instrumentation:log4j:log4j-2.7:javaagent")
include(":instrumentation:log4j:log4j-2.13.2:javaagent")
+include(":instrumentation:log4j:log4j-2.13.2:library")
include(":instrumentation:log4j:log4j-2.13.2:library-autoconfigure")
include(":instrumentation:log4j:log4j-2-common:testing")
include(":instrumentation:logback-1.0:javaagent")

Split out log4j appender (#4907)