Skip to content

Commit

Permalink
Rename apache-log4j-2 module to apache-log4j-2.11
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonjkeller committed Oct 31, 2023
1 parent 2ea3563 commit 02f5527
Show file tree
Hide file tree
Showing 15 changed files with 27 additions and 22 deletions.
23 changes: 23 additions & 0 deletions instrumentation/apache-log4j-2.11/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
jar {
manifest {
attributes 'Implementation-Title': 'com.newrelic.instrumentation.apache-log4j-2.11',
// The module was renamed to its current name from the name below. The alias exists so the instrumentation
// is still excluded/included for customers who have the old name in their configuration.
'Implementation-Title-Alias': 'com.newrelic.instrumentation.apache-log4j-2'
}
}

dependencies {
implementation(project(":agent-bridge"))
implementation("org.apache.logging.log4j:log4j-core:2.20.0")
}

verifyInstrumentation {
passesOnly("org.apache.logging.log4j:log4j-core:[2.11.0,)")
excludeRegex '.*(alpha|beta|rc).*'
}

site {
title 'Log4j2'
type 'Framework'
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static void recordNewRelicLogEvent(LogEvent event) {
if (shouldCreateLogEvent(message, throwable)) {
ReadOnlyStringMap contextData = event.getContextData();
Map<LogAttributeKey, Object> logEventMap = new HashMap<>(calculateInitialMapSize(contextData));
logEventMap.put(INSTRUMENTATION, "apache-log4j-2");
logEventMap.put(INSTRUMENTATION, "apache-log4j-2.11");
if (message != null) {
String formattedMessage = message.getFormattedMessage();
if (formattedMessage != null && !formattedMessage.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class LoggerConfig_Instrumentation {
public LoggerConfig_Instrumentation() {
// Generate the instrumentation module supportability metric only once
if (!instrumented.getAndSet(true)) {
NewRelic.incrementCounter("Supportability/Logging/Java/Log4j2/enabled");
NewRelic.incrementCounter("Supportability/Logging/Java/Log4j2.11/enabled");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class LoggerConfig_Instrumentation {
public LoggerConfig_Instrumentation() {
// Generate the instrumentation module supportability metric only once
if (!instrumented.getAndSet(true)) {
NewRelic.incrementCounter("Supportability/Logging/Java/Log4j2/enabled");
NewRelic.incrementCounter("Supportability/Logging/Java/Log4j2.6/enabled");
}
}

Expand Down
18 changes: 0 additions & 18 deletions instrumentation/apache-log4j-2/build.gradle

This file was deleted.

2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ include 'instrumentation:akka-http-core-10.0'
include 'instrumentation:akka-http-core-10.2.0'
include 'instrumentation:apache-log4j-1'
include 'instrumentation:apache-log4j-2.6'
include 'instrumentation:apache-log4j-2'
include 'instrumentation:apache-log4j-2.11'
include 'instrumentation:apache-struts-2.0'
include 'instrumentation:async-http-client-2.0.0'
include 'instrumentation:async-http-client-2.1.0'
Expand Down

0 comments on commit 02f5527

Please sign in to comment.