diff --git a/spring-boot-project/spring-boot-dependencies/build.gradle b/spring-boot-project/spring-boot-dependencies/build.gradle index 2d772daec2..7c462a6cf3 100644 --- a/spring-boot-project/spring-boot-dependencies/build.gradle +++ b/spring-boot-project/spring-boot-dependencies/build.gradle @@ -1121,7 +1121,7 @@ bom { releaseNotes("https://github.com/apache/logging-log4j2/releases/tag/rel%2F{version}") } } - library("Logback", "1.5.8") { + library("Logback", "1.5.10") { group("ch.qos.logback") { modules = [ "logback-classic", diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/logback/LogbackLoggingSystem.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/logback/LogbackLoggingSystem.java index cddd864a06..0f27d1dad1 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/logback/LogbackLoggingSystem.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/logback/LogbackLoggingSystem.java @@ -84,17 +84,20 @@ public class LogbackLoggingSystem extends AbstractLoggingSystem implements BeanF private static final String CONFIGURATION_FILE_PROPERTY = "logback.configurationFile"; - private static final LogLevels LEVELS = new LogLevels<>(); + private static final LogLevels LEVELS = createLogLevels(); - static { - LEVELS.map(LogLevel.TRACE, Level.TRACE); - LEVELS.map(LogLevel.TRACE, Level.ALL); - LEVELS.map(LogLevel.DEBUG, Level.DEBUG); - LEVELS.map(LogLevel.INFO, Level.INFO); - LEVELS.map(LogLevel.WARN, Level.WARN); - LEVELS.map(LogLevel.ERROR, Level.ERROR); - LEVELS.map(LogLevel.FATAL, Level.ERROR); - LEVELS.map(LogLevel.OFF, Level.OFF); + @SuppressWarnings("deprecation") + private static LogLevels createLogLevels() { + LogLevels levels = new LogLevels<>(); + levels.map(LogLevel.TRACE, Level.TRACE); + levels.map(LogLevel.TRACE, Level.ALL); + levels.map(LogLevel.DEBUG, Level.DEBUG); + levels.map(LogLevel.INFO, Level.INFO); + levels.map(LogLevel.WARN, Level.WARN); + levels.map(LogLevel.ERROR, Level.ERROR); + levels.map(LogLevel.FATAL, Level.ERROR); + levels.map(LogLevel.OFF, Level.OFF); + return levels; } private static final TurboFilter FILTER = new TurboFilter() { diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/logging/logback/LogbackLoggingSystemTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/logging/logback/LogbackLoggingSystemTests.java index 65adc53a10..7e98393139 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/logging/logback/LogbackLoggingSystemTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/logging/logback/LogbackLoggingSystemTests.java @@ -288,6 +288,7 @@ class LogbackLoggingSystemTests extends AbstractLoggingSystemTests { } @Test + @Deprecated(since = "3.3.5", forRemoval = true) void getLoggerConfigurationForALL() { this.loggingSystem.beforeInitialize(); initialize(this.initializationContext, null, null);