Skip to content

Commit 87182a3

Browse files
committed
Stop configuring the Logback console appender to use UTF-8
Previously, the default Logback configuration set the console appenders charset to UTF-8. This was inconsistent with the Logback file appender and Log4j2's console and file appenders, all of which used the platform's default. This commit removes the configuration of the Logback console appender's charset. This means that it will use the platform's default charset, aligning it with the Logback file appender and both Log4j2 appenders. Closes spring-projectsgh-11611
1 parent 54c0cf5 commit 87182a3

File tree

2 files changed

+0
-3
lines changed

2 files changed

+0
-3
lines changed

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package org.springframework.boot.logging.logback;
1818

1919
import java.lang.reflect.Method;
20-
import java.nio.charset.StandardCharsets;
2120

2221
import ch.qos.logback.classic.Level;
2322
import ch.qos.logback.classic.encoder.PatternLayoutEncoder;
@@ -117,7 +116,6 @@ private Appender<ILoggingEvent> consoleAppender(LogbackConfigurator config) {
117116
String logPattern = this.patterns.getProperty("logging.pattern.console",
118117
CONSOLE_LOG_PATTERN);
119118
encoder.setPattern(OptionHelper.substVars(logPattern, config.getContext()));
120-
encoder.setCharset(StandardCharsets.UTF_8);
121119
config.start(encoder);
122120
appender.setEncoder(encoder);
123121
config.appender("CONSOLE", appender);

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ initialization performed by Boot
99
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
1010
<encoder>
1111
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
12-
<charset>utf8</charset>
1312
</encoder>
1413
</appender>
1514
</included>

0 commit comments

Comments
 (0)