Skip to content

Commit 7e4defb

Browse files
committed
Properly guard LogbackLoggingSystem
Previously, LoggingSystem#get would chose Logback by the sole presence of a class in logback-core, with the assumption that logback-classic is also on the classpath. An app that only had the former would therefore fail. This commit updates the condition to check for a class in logback-classic instead. Closes gh-26711
1 parent 6474510 commit 7e4defb

File tree

1 file changed

+3
-2
lines changed
  • spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2021 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.
@@ -60,7 +60,8 @@ public abstract class LoggingSystem {
6060

6161
static {
6262
Map<String, String> systems = new LinkedHashMap<>();
63-
systems.put("ch.qos.logback.core.Appender", "org.springframework.boot.logging.logback.LogbackLoggingSystem");
63+
systems.put("ch.qos.logback.classic.LoggerContext",
64+
"org.springframework.boot.logging.logback.LogbackLoggingSystem");
6465
systems.put("org.apache.logging.log4j.core.impl.Log4jContextFactory",
6566
"org.springframework.boot.logging.log4j2.Log4J2LoggingSystem");
6667
systems.put("java.util.logging.LogManager", "org.springframework.boot.logging.java.JavaLoggingSystem");

0 commit comments

Comments
 (0)