Skip to content

Commit e7af34a

Browse files
committed
Revert "Merge pull request #41885 from mches"
This reverts commit 68d600e, reversing changes made to d4762ec. See gh-41885
1 parent 68d600e commit e7af34a

File tree

6 files changed

+4
-15
lines changed

6 files changed

+4
-15
lines changed

spring-boot-project/spring-boot-dependencies/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,7 @@ bom {
11211121
releaseNotes("https://github.com/apache/logging-log4j2/releases/tag/rel%2F{version}")
11221122
}
11231123
}
1124-
library("Logback", "1.5.7") {
1124+
library("Logback", "1.5.6") {
11251125
group("ch.qos.logback") {
11261126
modules = [
11271127
"logback-classic",

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/logback/DefaultLogbackConfiguration.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package org.springframework.boot.logging.logback;
1818

1919
import java.nio.charset.Charset;
20-
import java.util.concurrent.locks.ReentrantLock;
2120

2221
import ch.qos.logback.classic.Level;
2322
import ch.qos.logback.classic.encoder.PatternLayoutEncoder;
@@ -45,7 +44,6 @@
4544
* @author Robert Thornton
4645
* @author Scott Frederick
4746
* @author Jonatan Ivanov
48-
* @author Mark Chesney
4947
*/
5048
class DefaultLogbackConfiguration {
5149

@@ -56,9 +54,7 @@ class DefaultLogbackConfiguration {
5654
}
5755

5856
void apply(LogbackConfigurator config) {
59-
ReentrantLock lock = config.getConfigurationLock();
60-
lock.lock();
61-
try {
57+
synchronized (config.getConfigurationLock()) {
6258
defaults(config);
6359
Appender<ILoggingEvent> consoleAppender = consoleAppender(config);
6460
if (this.logFile != null) {
@@ -69,9 +65,6 @@ void apply(LogbackConfigurator config) {
6965
config.root(Level.INFO, consoleAppender);
7066
}
7167
}
72-
finally {
73-
lock.unlock();
74-
}
7568
}
7669

7770
private void defaults(LogbackConfigurator config) {

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/logback/LogbackConfigurator.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,7 +18,6 @@
1818

1919
import java.util.HashMap;
2020
import java.util.Map;
21-
import java.util.concurrent.locks.ReentrantLock;
2221

2322
import ch.qos.logback.classic.Level;
2423
import ch.qos.logback.classic.Logger;
@@ -50,7 +49,7 @@ LoggerContext getContext() {
5049
return this.context;
5150
}
5251

53-
ReentrantLock getConfigurationLock() {
52+
Object getConfigurationLock() {
5453
return this.context.getConfigurationLock();
5554
}
5655

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/logging/logback/LogbackLoggingSystemParallelInitializationTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ class LogbackLoggingSystemParallelInitializationTests {
4545
void cleanUp() {
4646
this.loggingSystem.cleanUp();
4747
((LoggerContext) LoggerFactory.getILoggerFactory()).stop();
48-
((LoggerContext) LoggerFactory.getILoggerFactory()).reset();
4948
}
5049

5150
@Test

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/logging/logback/LogbackLoggingSystemTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ void cleanUp() {
128128
System.getProperties().keySet().retainAll(this.systemPropertyNames);
129129
this.loggingSystem.cleanUp();
130130
((LoggerContext) LoggerFactory.getILoggerFactory()).stop();
131-
((LoggerContext) LoggerFactory.getILoggerFactory()).reset();
132131
}
133132

134133
@Test

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/logging/logback/SpringBootJoranConfiguratorTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ void setup(CapturedOutput output) {
7272
@AfterEach
7373
void reset() {
7474
this.context.stop();
75-
this.context.reset();
7675
new BasicConfigurator().configure((LoggerContext) LoggerFactory.getILoggerFactory());
7776
}
7877

0 commit comments

Comments
 (0)