From 3f27a213e4c889aba3c23b7c7d414b7843f7b9a9 Mon Sep 17 00:00:00 2001 From: tiennm99 Date: Fri, 14 Nov 2025 01:05:24 +0700 Subject: [PATCH] Update Log4j2 config and shadowJar transformer usage Removed the custom 'packages' attribute from log4j2.xml configuration and updated the shadowJar task to use the class reference for Log4j2PluginsCacheFileTransformer. This streamlines configuration and aligns with recommended usage. --- build.gradle.kts | 4 +--- src/main/resources/log4j2.xml | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index b404721..5bae0ab 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,3 @@ -import com.github.jengelman.gradle.plugins.shadow.transformers.Log4j2PluginsCacheFileTransformer - plugins { application idea @@ -61,7 +59,7 @@ repositories { } tasks.shadowJar { - transform(Log4j2PluginsCacheFileTransformer()) + transform(com.github.jengelman.gradle.plugins.shadow.transformers.Log4j2PluginsCacheFileTransformer::class.java) } tasks.test { diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml index 69248e8..69f8e1a 100644 --- a/src/main/resources/log4j2.xml +++ b/src/main/resources/log4j2.xml @@ -1,5 +1,5 @@ - + %d{HH:mm:ss.SSS} %5p --- [%t] %c : %m%n UTF-8