fix [ISSUE #12323] , using the project's logback packagingData configuration instead of logback-nacos.xml's packagingData configuration (#12360)

This commit is contained in:
dingjs 2024-07-18 11:10:09 +08:00 committed by GitHub
parent a6047fae45
commit 8664a1aec6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -109,7 +109,9 @@ public class LogbackNacosLoggingAdapter implements NacosLoggingAdapter {
configurator.setContext(loggerContext); configurator.setContext(loggerContext);
if (StringUtils.isNotBlank(location)) { if (StringUtils.isNotBlank(location)) {
try { try {
boolean isPackagingDataEnabled = loggerContext.isPackagingDataEnabled();
configurator.configure(ResourceUtils.getResourceUrl(location)); configurator.configure(ResourceUtils.getResourceUrl(location));
loggerContext.setPackagingDataEnabled(isPackagingDataEnabled);
} catch (Exception e) { } catch (Exception e) {
throw new IllegalStateException("Could not initialize Logback Nacos logging from " + location, e); throw new IllegalStateException("Could not initialize Logback Nacos logging from " + location, e);
} }