tomcat8 日志路径,乱码,自动分割 问题解决
Posted 大爷来玩呀你懂得
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了tomcat8 日志路径,乱码,自动分割 问题解决相关的知识,希望对你有一定的参考价值。
日志乱码
vim catalina.sh
- 在如图所示处 添加 -Dfile.encoding=UTF-8
JAVA_OPTS="$JAVA_OPTS -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dfile.encoding=UTF-8"
日志路径
vim catalina.sh
- 在如图所示修改 CATALINA_OUT=
if [ -z "$CATALINA_OUT" ] ; then
#CATALINA_OUT="$CATALINA_BASE"/logs/catalina.out
CATALINA_OUT=/data/WEBLOG/uat-ecommerce-app/catalina.out
fi
日志自动分割
- [root@tomcat-uata_20 conf]# vim logging.properties
1catalina.org.apache.juli.AsyncFileHandler.level = FINE
1catalina.org.apache.juli.AsyncFileHandler.directory = /data/WEBLOG/uat-ecommerce-app
1catalina.org.apache.juli.AsyncFileHandler.prefix = catalina.
1catalina.org.apache.juli.AsyncFileHandler.encoding = UTF-8
2localhost.org.apache.juli.AsyncFileHandler.level = FINE
2localhost.org.apache.juli.AsyncFileHandler.directory = /data/WEBLOG/uat-ecommerce-app
2localhost.org.apache.juli.AsyncFileHandler.prefix = localhost.
2localhost.org.apache.juli.AsyncFileHandler.encoding = UTF-8
3manager.org.apache.juli.AsyncFileHandler.level = FINE
3manager.org.apache.juli.AsyncFileHandler.directory = /data/WEBLOG/uat-ecommerce-app
3manager.org.apache.juli.AsyncFileHandler.prefix = manager.
3manager.org.apache.juli.AsyncFileHandler.encoding = UTF-8
4host-manager.org.apache.juli.AsyncFileHandler.level = FINE
4host-manager.org.apache.juli.AsyncFileHandler.directory = /data/WEBLOG/uat-ecommerce-app
4host-manager.org.apache.juli.AsyncFileHandler.prefix = host-manager.
4host-manager.org.apache.juli.AsyncFileHandler.encoding = UTF-8
java.util.logging.ConsoleHandler.level = FINE
java.util.logging.ConsoleHandler.formatter = org.apache.juli.OneLineFormatter
java.util.logging.ConsoleHandler.encoding = UTF-8
以上是关于tomcat8 日志路径,乱码,自动分割 问题解决的主要内容,如果未能解决你的问题,请参考以下文章