From 6415e2841980be9d72c80b959d12bc42521755f2 Mon Sep 17 00:00:00 2001
From: water <672684719@qq.com>
Date: Tue, 25 Aug 2026 17:49:34 +0800
Subject: [PATCH 1/2] fix: restore Log4j2Plugins.dat in apm-toolkit-log4j-2.x
Since 9.5.0 the released apm-toolkit-log4j-2.x jar no longer contains META-INF/org/apache/logging/log4j/core/config/plugins/Log4j2Plugins.dat. Root cause: the root pom declares annotationProcessorPaths (Lombok only), which makes javac stop discovering annotation processors from the compile classpath. Log4j2's PluginProcessor from the provided log4j-core dependency never runs, so %traceId and %sw_ctx silently break.
Declare the compiler plugin in this module with annotationProcessorPaths including both Lombok and log4j-core.
---
.../apm-toolkit-log4j-2.x/pom.xml | 30 +++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/apm-application-toolkit/apm-toolkit-log4j-2.x/pom.xml b/apm-application-toolkit/apm-toolkit-log4j-2.x/pom.xml
index 8c53d53868..69ac75ceba 100644
--- a/apm-application-toolkit/apm-toolkit-log4j-2.x/pom.xml
+++ b/apm-application-toolkit/apm-toolkit-log4j-2.x/pom.xml
@@ -39,4 +39,34 @@
provided
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+
+
+
+
+ org.projectlombok
+ lombok
+ ${lombok.version}
+
+
+ org.apache.logging.log4j
+ log4j-core
+ ${log4j-core.version}
+
+
+
+
+
+
From dfca52b419376d3d788d10f5c090b3b9b2dee16d Mon Sep 17 00:00:00 2001
From: waterWang
Date: Thu, 27 Aug 2026 16:53:20 +0800
Subject: [PATCH 2/2] fix: restore Log4j2Plugins.dat in apm-toolkit-log4j-2.x
Use combine.children="append" so the Lombok entry stays inherited from the root POM,
and add the CHANGES.md entry. Resolves apache/skywalking#14006.
---
CHANGES.md | 1 +
.../apm-toolkit-log4j-2.x/pom.xml | 19 ++++++++-----------
2 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/CHANGES.md b/CHANGES.md
index 085a52a0ad..138d0ab5a2 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -6,6 +6,7 @@ Release Notes.
------------------
* Add Spring LDAP 3.3.x-4.x plugin.
+* Fix the Log4j2 plugin descriptor (`Log4j2Plugins.dat`) missing from the `apm-toolkit-log4j-2.x` jar since 9.5.0, which broke `%traceId` and `%sw_ctx` resolution in Log4j2 `PatternLayout` (apache/skywalking#14006).
All issues and pull requests are [here](https://github.com/apache/skywalking/milestone/263?closed=1)
diff --git a/apm-application-toolkit/apm-toolkit-log4j-2.x/pom.xml b/apm-application-toolkit/apm-toolkit-log4j-2.x/pom.xml
index 69ac75ceba..244588b3a5 100644
--- a/apm-application-toolkit/apm-toolkit-log4j-2.x/pom.xml
+++ b/apm-application-toolkit/apm-toolkit-log4j-2.x/pom.xml
@@ -47,18 +47,15 @@
maven-compiler-plugin
-
-
- org.projectlombok
- lombok
- ${lombok.version}
-
+
org.apache.logging.log4j
log4j-core