[Switch] The solution to the problem of garbled log4j log files

For log4j.properties configuration file:

log4j.appender.A1=org.apache.log4j.RollingFileAppender
log4j.appender.A1.Encoding=UTF-8
log4j.appender.A1.File=all.log

 For log4j.xml configuration file:

 

<appender name="A1" class="org.apache.log4j.RollingFileAppender">
        <param name="Encoding" value="UTF-8" />
        <param name="File" value="all.log" />
        ......
</appender>

 

(From: http://blog.csdn.net/inkfish/article/details/4761357 )

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326615208&siteId=291194637