http://blog.csdn.net/lzc3144/article/details/7643210
Use log4j, when the win system in the normal display of Chinese, but published to the Linux system when Chinese will appear garbled
Because the encoding format (encoding) is not set in the log4j configuration file, Log4j uses the system default encoding. Lead to garbled characters.
The solution is to set the encoding format UTF-8 (sometimes changed to UTF-8 or garbled, need to be set to GBK, which may be related to the encoding of the character you entered):
Log4j.appender.logfile.encoding=utf-8
# # # File Log #####
Log4j.appender.logfile=org.apache.log4j.rollingfileappender
Log4j.appender.logfile.file=d:/log/shop/logs.log
Log4j.appender.logfile.maxfilesize=5mb
Log4j.appender.logfile.threshold=debug
Log4j.appender.logfile.layout=org.apache.log4j.patternlayout
LOG4J.APPENDER.LOGFILE.LAYOUT.CONVERSIONPATTERN=[%D{MM/DDHH:MM:SS,SSS}] [%-3p]%c{1}:%m%n
Log4j.appender.logfile.encoding=utf-8