Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split out log4j appender #4907

Merged
merged 1 commit into from
Dec 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,11 @@ plugins {
}

dependencies {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this module include implementation(project("...:log4j-2.13.2:library"))?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this case is a bit odd. the autoconfigure instrumentation doesn't enable the appender (library) instrumentation. another option is to rename library-autoconfigure to library-context-data.... I'll open an issue to discuss and track

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
// around it.
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")
}
13 changes: 13 additions & 0 deletions instrumentation/log4j/log4j-2.13.2/library/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
plugins {
id("otel.library-instrumentation")
}

dependencies {
compileOnly("io.opentelemetry:opentelemetry-sdk-logs")

library("org.apache.logging.log4j:log4j-core:2.13.2")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As nobody in its right mind is going to use this version of log4j, should we just start with 2.16? :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ya, I think this is the only instrumentation that targets a "patch" version too, will do this in follow-up 👍


testImplementation("io.opentelemetry:opentelemetry-sdk-logs")

testImplementation("org.mockito:mockito-core")
}
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down