Revert "Merge pull request #41885 from mches"

This reverts commit 68d600e9da, reversing
changes made to d4762eca22.

See gh-41885
This commit is contained in:
Stéphane Nicoll 2024-08-16 16:52:59 +02:00
parent 68d600e9da
commit e7af34a7ca
6 changed files with 4 additions and 15 deletions

View File

@ -1121,7 +1121,7 @@ bom {
releaseNotes("https://github.com/apache/logging-log4j2/releases/tag/rel%2F{version}")
}
}
library("Logback", "1.5.7") {
library("Logback", "1.5.6") {
group("ch.qos.logback") {
modules = [
"logback-classic",

View File

@ -17,7 +17,6 @@
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;
@ -45,7 +44,6 @@ import org.springframework.boot.logging.LogFile;
* @author Robert Thornton
* @author Scott Frederick
* @author Jonatan Ivanov
* @author Mark Chesney
*/
class DefaultLogbackConfiguration {
@ -56,9 +54,7 @@ class DefaultLogbackConfiguration {
}
void apply(LogbackConfigurator config) {
ReentrantLock lock = config.getConfigurationLock();
lock.lock();
try {
synchronized (config.getConfigurationLock()) {
defaults(config);
Appender<ILoggingEvent> consoleAppender = consoleAppender(config);
if (this.logFile != null) {
@ -69,9 +65,6 @@ class DefaultLogbackConfiguration {
config.root(Level.INFO, consoleAppender);
}
}
finally {
lock.unlock();
}
}
private void defaults(LogbackConfigurator config) {

View File

@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the original author or authors.
* Copyright 2012-2023 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,7 +18,6 @@ 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;
@ -50,7 +49,7 @@ class LogbackConfigurator {
return this.context;
}
ReentrantLock getConfigurationLock() {
Object getConfigurationLock() {
return this.context.getConfigurationLock();
}

View File

@ -45,7 +45,6 @@ class LogbackLoggingSystemParallelInitializationTests {
void cleanUp() {
this.loggingSystem.cleanUp();
((LoggerContext) LoggerFactory.getILoggerFactory()).stop();
((LoggerContext) LoggerFactory.getILoggerFactory()).reset();
}
@Test

View File

@ -128,7 +128,6 @@ class LogbackLoggingSystemTests extends AbstractLoggingSystemTests {
System.getProperties().keySet().retainAll(this.systemPropertyNames);
this.loggingSystem.cleanUp();
((LoggerContext) LoggerFactory.getILoggerFactory()).stop();
((LoggerContext) LoggerFactory.getILoggerFactory()).reset();
}
@Test

View File

@ -72,7 +72,6 @@ class SpringBootJoranConfiguratorTests {
@AfterEach
void reset() {
this.context.stop();
this.context.reset();
new BasicConfigurator().configure((LoggerContext) LoggerFactory.getILoggerFactory());
}