diff --git a/spring-boot-project/spring-boot/src/main/resources/org/springframework/boot/logging/logback/defaults.xml b/spring-boot-project/spring-boot/src/main/resources/org/springframework/boot/logging/logback/defaults.xml index a469b4cba9c..fa4006d2fc4 100644 --- a/spring-boot-project/spring-boot/src/main/resources/org/springframework/boot/logging/logback/defaults.xml +++ b/spring-boot-project/spring-boot/src/main/resources/org/springframework/boot/logging/logback/defaults.xml @@ -5,11 +5,11 @@ Default logback configuration provided for import --> - - - - - + + + + + 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 995c25f8804..0c978d8789a 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 @@ -130,6 +130,22 @@ class LogbackLoggingSystemTests extends AbstractLoggingSystemTests { ((LoggerContext) LoggerFactory.getILoggerFactory()).stop(); } + @Test + void logbackDefaultsConfigurationDoesNotTriggerDeprecation(CapturedOutput output) { + initialize(this.initializationContext, "classpath:logback-include-defaults.xml", null); + this.logger.info("Hello world"); + assertThat(getLineWithText(output, "Hello world")).isEqualTo("[INFO] - Hello world"); + assertThat(output.toString()).doesNotContain("WARN").doesNotContain("deprecated"); + } + + @Test + void logbackBaseConfigurationDoesNotTriggerDeprecation(CapturedOutput output) { + initialize(this.initializationContext, "classpath:logback-include-base.xml", null); + this.logger.info("Hello world"); + assertThat(getLineWithText(output, "Hello world")).contains(" INFO ").endsWith(": Hello world"); + assertThat(output.toString()).doesNotContain("WARN").doesNotContain("deprecated"); + } + @Test @ClassPathOverrides({ "org.jboss.logging:jboss-logging:3.5.0.Final", "org.apache.logging.log4j:log4j-core:2.19.0" }) void jbossLoggingRoutesThroughLog4j2ByDefault() { diff --git a/spring-boot-project/spring-boot/src/test/resources/logback-include-defaults.xml b/spring-boot-project/spring-boot/src/test/resources/logback-include-defaults.xml new file mode 100644 index 00000000000..76b3943cd2f --- /dev/null +++ b/spring-boot-project/spring-boot/src/test/resources/logback-include-defaults.xml @@ -0,0 +1,12 @@ + + + + + + [%p] - %m%n + + + + + +