-
解决方法:
如果是log4j.properties为配置文件,比如:
- log4j.appender.A1=org.apache.log4j.RollingFileAppender
- log4j.appender.A1.File=all.log
加入一行:
- log4j.appender.A1=org.apache.log4j.RollingFileAppender
- log4j.appender.A1.Encoding=UTF-8
- log4j.appender.A1.File=all.log
如果是log4j.xml为配置文件,比如:.
<appender name="A1" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="all.log" />
......
</appender>
加入一行:
<appender name="A1" class="org.apache.log4j.RollingFileAppender">
<param name="Encoding" value="UTF-8" />
<param name="File" value="all.log" />
......
</appender>