Commit 87182a3a authored by Andy Wilkinson's avatar Andy Wilkinson

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 gh-11611
parent 54c0cf51
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
package org.springframework.boot.logging.logback; package org.springframework.boot.logging.logback;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.nio.charset.StandardCharsets;
import ch.qos.logback.classic.Level; import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.encoder.PatternLayoutEncoder; import ch.qos.logback.classic.encoder.PatternLayoutEncoder;
...@@ -117,7 +116,6 @@ class DefaultLogbackConfiguration { ...@@ -117,7 +116,6 @@ class DefaultLogbackConfiguration {
String logPattern = this.patterns.getProperty("logging.pattern.console", String logPattern = this.patterns.getProperty("logging.pattern.console",
CONSOLE_LOG_PATTERN); CONSOLE_LOG_PATTERN);
encoder.setPattern(OptionHelper.substVars(logPattern, config.getContext())); encoder.setPattern(OptionHelper.substVars(logPattern, config.getContext()));
encoder.setCharset(StandardCharsets.UTF_8);
config.start(encoder); config.start(encoder);
appender.setEncoder(encoder); appender.setEncoder(encoder);
config.appender("CONSOLE", appender); config.appender("CONSOLE", appender);
......
...@@ -9,7 +9,6 @@ initialization performed by Boot ...@@ -9,7 +9,6 @@ initialization performed by Boot
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder> <encoder>
<pattern>${CONSOLE_LOG_PATTERN}</pattern> <pattern>${CONSOLE_LOG_PATTERN}</pattern>
<charset>utf8</charset>
</encoder> </encoder>
</appender> </appender>
</included> </included>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment