Tomcat conf(配置文件中的logging.properties(日志记录.属性详解))
作者:互联网
目录位置:
日志文件默认是UTF-8是不会乱码的
#catalina 就是Tomcat服务器使用的 Apache实现的servlet容器的 名字。
#Tomcat的核心分为3个部分:
#(1)Web容器---处理静态页面;
#(2)catalina --- 一个servlet容器-----处理servlet;
#(3)还有就是JSP容器,它就是把jsp页面翻译成一般的servlet。
#IDEA部署到tomcat时,首先启动tomcat的catalina
#下面四个都是log(日志的编码)
#(2)catalina --- 一个servlet容器-----处理servlet;
1catalina.org.apache.juli.AsyncFileHandler.level = FINE
1catalina.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
1catalina.org.apache.juli.AsyncFileHandler.prefix = catalina.
1catalina.org.apache.juli.AsyncFileHandler.maxDays = 90
1catalina.org.apache.juli.AsyncFileHandler.encoding = UTF-8
2localhost.org.apache.juli.AsyncFileHandler.level = FINE
2localhost.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
2localhost.org.apache.juli.AsyncFileHandler.prefix = localhost.
2localhost.org.apache.juli.AsyncFileHandler.maxDays = 90
2localhost.org.apache.juli.AsyncFileHandler.encoding = UTF-8
3manager.org.apache.juli.AsyncFileHandler.level = FINE
3manager.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
3manager.org.apache.juli.AsyncFileHandler.prefix = manager.
3manager.org.apache.juli.AsyncFileHandler.maxDays = 90
3manager.org.apache.juli.AsyncFileHandler.encoding = UTF-8
4host-manager.org.apache.juli.AsyncFileHandler.level = FINE
4host-manager.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
4host-manager.org.apache.juli.AsyncFileHandler.prefix = host-manager.
4host-manager.org.apache.juli.AsyncFileHandler.maxDays = 90
4host-manager.org.apache.juli.AsyncFileHandler.encoding = UTF-8
#这个是控制台的编码(默认是UTF-8是乱码的)GBK是中文的
java.util.logging.ConsoleHandler.level = FINE
java.util.logging.ConsoleHandler.formatter = org.apache.juli.OneLineFormatter
java.util.logging.ConsoleHandler.encoding = GBK
控制台是指这里(这里是默认的UTF-8,会乱码的)不乱码就改成GBK
上面的日志编码分别是对应的编码格式默认UTF-8日志文件是不会出现乱码的改成GBK反而会乱码所以这里一定要谨慎
标签:catalina,logging,配置文件,Tomcat,juli,UTF,apache,org,AsyncFileHandler 来源: https://blog.csdn.net/CSDN_RLZ/article/details/115164763