代码优化提交
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<!--
|
||||
charset 不硬编码,由 JVM 的 file.encoding 决定:
|
||||
- exe 模式: file.encoding=UTF-8 → logback 输出 UTF-8
|
||||
- IDEA 环境: file.encoding=GBK → logback 输出 GBK
|
||||
确保 logback 与控制台解码器使用相同编码,避免乱码。
|
||||
-->
|
||||
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<!-- encoders are assigned the type ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
|
||||
<encoder>
|
||||
<charset>UTF-8</charset>
|
||||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
Reference in New Issue
Block a user