Skip to content

Commit a7c5edb

Browse files
committed
Merge branch '3.3.x'
Closes gh-42008
2 parents e80422a + aea45b5 commit a7c5edb

File tree

3 files changed

+34
-6
lines changed

3 files changed

+34
-6
lines changed

spring-boot-project/spring-boot/src/main/resources/org/springframework/boot/logging/logback/defaults.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ Default logback configuration provided for import
55
-->
66

77
<included>
8-
<conversionRule conversionWord="applicationName" converterClass="org.springframework.boot.logging.logback.ApplicationNameConverter" />
9-
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
10-
<conversionRule conversionWord="correlationId" converterClass="org.springframework.boot.logging.logback.CorrelationIdConverter" />
11-
<conversionRule conversionWord="esb" converterClass="org.springframework.boot.logging.logback.EnclosedInSquareBracketsConverter" />
12-
<conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
13-
<conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />
8+
<conversionRule conversionWord="applicationName" class="org.springframework.boot.logging.logback.ApplicationNameConverter" />
9+
<conversionRule conversionWord="clr" class="org.springframework.boot.logging.logback.ColorConverter" />
10+
<conversionRule conversionWord="correlationId" class="org.springframework.boot.logging.logback.CorrelationIdConverter" />
11+
<conversionRule conversionWord="esb" class="org.springframework.boot.logging.logback.EnclosedInSquareBracketsConverter" />
12+
<conversionRule conversionWord="wex" class="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
13+
<conversionRule conversionWord="wEx" class="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />
1414

1515
<property name="CONSOLE_LOG_PATTERN" value="${CONSOLE_LOG_PATTERN:-%clr(%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd'T'HH:mm:ss.SSSXXX}}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}){} %clr(${PID:-}){magenta} %clr(--- %esb(){APPLICATION_NAME}%esb{APPLICATION_GROUP}[%15.15t] ${LOG_CORRELATION_PATTERN:-}){faint}%clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
1616
<property name="CONSOLE_LOG_CHARSET" value="${CONSOLE_LOG_CHARSET:-${file.encoding:-UTF-8}}"/>

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,22 @@ void cleanUp() {
129129
((LoggerContext) LoggerFactory.getILoggerFactory()).stop();
130130
}
131131

132+
@Test
133+
void logbackDefaultsConfigurationDoesNotTriggerDeprecation(CapturedOutput output) {
134+
initialize(this.initializationContext, "classpath:logback-include-defaults.xml", null);
135+
this.logger.info("Hello world");
136+
assertThat(getLineWithText(output, "Hello world")).isEqualTo("[INFO] - Hello world");
137+
assertThat(output.toString()).doesNotContain("WARN").doesNotContain("deprecated");
138+
}
139+
140+
@Test
141+
void logbackBaseConfigurationDoesNotTriggerDeprecation(CapturedOutput output) {
142+
initialize(this.initializationContext, "classpath:logback-include-base.xml", null);
143+
this.logger.info("Hello world");
144+
assertThat(getLineWithText(output, "Hello world")).contains(" INFO ").endsWith(": Hello world");
145+
assertThat(output.toString()).doesNotContain("WARN").doesNotContain("deprecated");
146+
}
147+
132148
@Test
133149
@ClassPathOverrides({ "org.jboss.logging:jboss-logging:3.5.0.Final", "org.apache.logging.log4j:log4j-core:2.19.0" })
134150
void jbossLoggingRoutesThroughLog4j2ByDefault() {
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<configuration>
3+
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
4+
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
5+
<encoder>
6+
<pattern>[%p] - %m%n</pattern>
7+
</encoder>
8+
</appender>
9+
<root level="INFO">
10+
<appender-ref ref="CONSOLE" />
11+
</root>
12+
</configuration>

0 commit comments

Comments
 (0)