From 87182a3a2b31c6f0f7b8042e5afa01104d1c8f07 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Wed, 17 Jan 2018 19:07:34 +0000 Subject: [PATCH] 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 --- .../boot/logging/logback/DefaultLogbackConfiguration.java | 2 -- .../springframework/boot/logging/logback/console-appender.xml | 1 - 2 files changed, 3 deletions(-) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/logback/DefaultLogbackConfiguration.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/logback/DefaultLogbackConfiguration.java index 914829072b1..d0d29b02696 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/logback/DefaultLogbackConfiguration.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/logback/DefaultLogbackConfiguration.java @@ -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); diff --git a/spring-boot-project/spring-boot/src/main/resources/org/springframework/boot/logging/logback/console-appender.xml b/spring-boot-project/spring-boot/src/main/resources/org/springframework/boot/logging/logback/console-appender.xml index 6e84f416053..92d0da03f82 100644 --- a/spring-boot-project/spring-boot/src/main/resources/org/springframework/boot/logging/logback/console-appender.xml +++ b/spring-boot-project/spring-boot/src/main/resources/org/springframework/boot/logging/logback/console-appender.xml @@ -9,7 +9,6 @@ initialization performed by Boot ${CONSOLE_LOG_PATTERN} - utf8