从网上查询资料

获得以下结果

1 设置 project 和file 文件为utf-8 编码

2 设置 logback 文件内容 

<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
    <encoder charset="UTF-8">
        <pattern>${date_pattern}</pattern>
    </encoder>
</appender>

 

添加 encoder 属性。

3 设置 tomcat 启动选项,

添加 

JAVA_OPTS="$JAVA_OPTS  -Dfile.encoding=UTF-8" 

但是都没有解决我的问题,
 
到底为什么?
因为我用的是xshell,而且是在windows 上 安装的,所以xshell默认使用的编码应该是gbk 就是这个问题。
解决办法就是 设置xshell的编码为utf8.
解决线上服务logback 乱码问题

相关文章:

  • 2022-02-04
  • 2021-04-29
  • 2022-12-23
  • 2021-12-27
  • 2022-12-23
  • 2021-07-18
  • 2021-07-25
  • 2021-11-09
猜你喜欢
  • 2021-05-21
  • 2021-07-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-19
相关资源
相似解决方案