From 142b86fb0e301a11c7d533c27dcc737b59beae4c Mon Sep 17 00:00:00 2001 From: dingjs Date: Tue, 16 Jul 2024 22:25:56 +0800 Subject: [PATCH] fix [ISSUE #12323] , using the project's logback packagingData configuration instead of logback-nacos.xml's packagingData configuration --- .../logger/adapter/logback12/LogbackNacosLoggingAdapter.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/logger-adapter-impl/logback-adapter-12/src/main/java/com/alibaba/nacos/logger/adapter/logback12/LogbackNacosLoggingAdapter.java b/logger-adapter-impl/logback-adapter-12/src/main/java/com/alibaba/nacos/logger/adapter/logback12/LogbackNacosLoggingAdapter.java index b6049362819..07d3f6106e5 100644 --- a/logger-adapter-impl/logback-adapter-12/src/main/java/com/alibaba/nacos/logger/adapter/logback12/LogbackNacosLoggingAdapter.java +++ b/logger-adapter-impl/logback-adapter-12/src/main/java/com/alibaba/nacos/logger/adapter/logback12/LogbackNacosLoggingAdapter.java @@ -109,7 +109,9 @@ private LoggerContext loadConfigurationOnStart(final String location) { configurator.setContext(loggerContext); if (StringUtils.isNotBlank(location)) { try { + boolean isPackagingDataEnabled = loggerContext.isPackagingDataEnabled(); configurator.configure(ResourceUtils.getResourceUrl(location)); + loggerContext.setPackagingDataEnabled(isPackagingDataEnabled); } catch (Exception e) { throw new IllegalStateException("Could not initialize Logback Nacos logging from " + location, e); }