when I use net.logstash.logback.encoder.LogstashEncoder output chinese words to log file, they always change to unicode char, like \u5FAE\u670D\u52A1\u51FA\u9519\uFF0C\u8BF7,
I've tried config charset=utf-8 whin LogstashEncoder, but it's not working,
Could someone tell me what can i do? thank you!
my logback.xml:
<appender name="stash" class="ch.qos.logback.core.rolling.RollingFileAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>info</level>
</filter>
<file>${catalina.home}/logs/sublogs/development.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${catalina.home}/logs/sublogs/development.log.%d{yyyy-MM-dd}</fileNamePattern>
<maxHistory>30</maxHistory>
</rollingPolicy>
<encoder class="net.logstash.logback.encoder.LogstashEncoder">
<charset>UTF-8</charset>
</encoder>
</appender>
Use charset="UTF-8" as argument. It works for me: