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
pull/11665/head
Andy Wilkinson 7 years ago
parent 54c0cf513b
commit 87182a3a2b

@ -17,7 +17,6 @@
package org.springframework.boot.logging.logback;
import java.lang.reflect.Method;
import java.nio.charset.StandardCharsets;
import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.encoder.PatternLayoutEncoder;
@ -117,7 +116,6 @@ class DefaultLogbackConfiguration {
String logPattern = this.patterns.getProperty("logging.pattern.console",
CONSOLE_LOG_PATTERN);
encoder.setPattern(OptionHelper.substVars(logPattern, config.getContext()));
encoder.setCharset(StandardCharsets.UTF_8);
config.start(encoder);
appender.setEncoder(encoder);
config.appender("CONSOLE", appender);

@ -9,7 +9,6 @@ initialization performed by Boot
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
<charset>utf8</charset>
</encoder>
</appender>
</included>

Loading…
Cancel
Save