Skip to content

Commit 5e42f27

Browse files
committed
Merge branch '2.4.x' into 2.5.x
Closes gh-28486
2 parents 7fe6f48 + e4e1958 commit 5e42f27

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,14 @@ private void defaults(LogbackConfigurator config) {
7171
+ "%clr(%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) "
7272
+ "%clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} "
7373
+ "%clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"));
74-
config.getContext().putProperty("CONSOLE_LOG_CHARSET", resolve(config, "${CONSOLE_LOG_CHARSET:-default}"));
74+
String defaultCharset = Charset.defaultCharset().name();
75+
config.getContext().putProperty("CONSOLE_LOG_CHARSET",
76+
resolve(config, "${CONSOLE_LOG_CHARSET:-" + defaultCharset + "}"));
7577
config.getContext().putProperty("FILE_LOG_PATTERN", resolve(config, "${FILE_LOG_PATTERN:-"
7678
+ "%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}} ${LOG_LEVEL_PATTERN:-%5p} ${PID:- } --- [%t] "
7779
+ "%-40.40logger{39} : %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"));
78-
config.getContext().putProperty("FILE_LOG_CHARSET", resolve(config, "${FILE_LOG_CHARSET:-default}"));
80+
config.getContext().putProperty("FILE_LOG_CHARSET",
81+
resolve(config, "${FILE_LOG_CHARSET:-" + defaultCharset + "}"));
7982
config.logger("org.apache.catalina.startup.DigesterFactory", Level.ERROR);
8083
config.logger("org.apache.catalina.util.LifecycleBase", Level.ERROR);
8184
config.logger("org.apache.coyote.http11.Http11NioProtocol", Level.WARN);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ Default logback configuration provided for import
1010
<conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />
1111

1212
<property name="CONSOLE_LOG_PATTERN" value="${CONSOLE_LOG_PATTERN:-%clr(%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
13-
<property name="CONSOLE_LOG_CHARSET" value="${CONSOLE_LOG_CHARSET:-default}"/>
13+
<property name="CONSOLE_LOG_CHARSET" value="${CONSOLE_LOG_CHARSET:-${file.encoding:-UTF-8}}"/>
1414
<property name="FILE_LOG_PATTERN" value="${FILE_LOG_PATTERN:-%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}} ${LOG_LEVEL_PATTERN:-%5p} ${PID:- } --- [%t] %-40.40logger{39} : %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
15-
<property name="FILE_LOG_CHARSET" value="${FILE_LOG_CHARSET:-default}"/>
15+
<property name="FILE_LOG_CHARSET" value="${FILE_LOG_CHARSET:-${file.encoding:-UTF-8}}"/>
1616

1717
<logger name="org.apache.catalina.startup.DigesterFactory" level="ERROR"/>
1818
<logger name="org.apache.catalina.util.LifecycleBase" level="ERROR"/>

0 commit comments

Comments
 (0)