commit
c9833d7aa8
|
@ -1141,7 +1141,7 @@ bom {
|
|||
releaseNotes("https://github.com/apache/logging-log4j2/releases/tag/rel%2F{version}")
|
||||
}
|
||||
}
|
||||
library("Logback", "1.5.6") {
|
||||
library("Logback", "1.5.7") {
|
||||
group("ch.qos.logback") {
|
||||
modules = [
|
||||
"logback-classic",
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
package org.springframework.boot.logging.logback;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
import ch.qos.logback.classic.Level;
|
||||
import ch.qos.logback.classic.encoder.PatternLayoutEncoder;
|
||||
|
@ -51,6 +52,7 @@ import org.springframework.util.StringUtils;
|
|||
* @author Scott Frederick
|
||||
* @author Jonatan Ivanov
|
||||
* @author Moritz Halbritter
|
||||
* @author Mark Chesney
|
||||
*/
|
||||
class DefaultLogbackConfiguration {
|
||||
|
||||
|
@ -80,7 +82,9 @@ class DefaultLogbackConfiguration {
|
|||
}
|
||||
|
||||
void apply(LogbackConfigurator config) {
|
||||
synchronized (config.getConfigurationLock()) {
|
||||
ReentrantLock lock = config.getConfigurationLock();
|
||||
lock.lock();
|
||||
try {
|
||||
defaults(config);
|
||||
Appender<ILoggingEvent> consoleAppender = consoleAppender(config);
|
||||
if (this.logFile != null) {
|
||||
|
@ -91,6 +95,9 @@ class DefaultLogbackConfiguration {
|
|||
config.root(Level.INFO, consoleAppender);
|
||||
}
|
||||
}
|
||||
finally {
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
private void defaults(LogbackConfigurator config) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -18,6 +18,7 @@ package org.springframework.boot.logging.logback;
|
|||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
import ch.qos.logback.classic.Level;
|
||||
import ch.qos.logback.classic.Logger;
|
||||
|
@ -49,7 +50,7 @@ class LogbackConfigurator {
|
|||
return this.context;
|
||||
}
|
||||
|
||||
Object getConfigurationLock() {
|
||||
ReentrantLock getConfigurationLock() {
|
||||
return this.context.getConfigurationLock();
|
||||
}
|
||||
|
||||
|
|
|
@ -45,6 +45,7 @@ class LogbackLoggingSystemParallelInitializationTests {
|
|||
void cleanUp() {
|
||||
this.loggingSystem.cleanUp();
|
||||
((LoggerContext) LoggerFactory.getILoggerFactory()).stop();
|
||||
((LoggerContext) LoggerFactory.getILoggerFactory()).reset();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -127,6 +127,7 @@ class LogbackLoggingSystemTests extends AbstractLoggingSystemTests {
|
|||
System.getProperties().keySet().retainAll(this.systemPropertyNames);
|
||||
this.loggingSystem.cleanUp();
|
||||
((LoggerContext) LoggerFactory.getILoggerFactory()).stop();
|
||||
((LoggerContext) LoggerFactory.getILoggerFactory()).reset();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -72,6 +72,7 @@ class SpringBootJoranConfiguratorTests {
|
|||
@AfterEach
|
||||
void reset() {
|
||||
this.context.stop();
|
||||
this.context.reset();
|
||||
new BasicConfigurator().configure((LoggerContext) LoggerFactory.getILoggerFactory());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue