tomcat日志里面都是写的什么东西

1.一下是tomcat下面conf/logging.properties

2.可通过下面中文解释修改日志输出级别

3.Tomcat的日志级别与类型

tomcat 日志分为下面5类:
catalina 、 localhost 、 manager 、 admin 、 host-manager
每类日志的级别分为如下 7 种:
SEVERE (highest value) > WARNING > INFO > CONFIG > FINE > FINER > FINEST (lowest value)
 

4.服务器里面的日志建议禁止输出访问日志可注释conf/server.xml

 

-------------------------------------------tomcat日志内容详解

#可配置项(5类日志):catalina、localhost、manager、admin、host-manager
handlers = 1catalina.org.apache.juli.FileHandler, 2localhost.org.apache.juli.FileHandler,
3manager.org.apache.juli.FileHandler, 4host-manager.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
 
#日志输出为输出到文件和输出到控制台
.handlers = 1catalina.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
 
#日志输出级别:SEVERE (最高级别) > WARNING > INFO > CONFIG > FINE > FINER(精心) > FINEST (所有内容,最低级别)
#配置文件使catalina日志输出级别为FINE
1catalina.org.apache.juli.FileHandler.level = FINE
#catalina文件输出位置
1catalina.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
#catalina日志前缀为catalina
1catalina.org.apache.juli.FileHandler.prefix = catalina.
 
#配置文件使localhost日志输出级别为FINE
2localhost.org.apache.juli.FileHandler.level = FINE
#localhost文件输出位置
2localhost.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
#localhost日志前缀为localhost
2localhost.org.apache.juli.FileHandler.prefix = localhost.
 
#配置文件使manager日志输出级别为FINE
3manager.org.apache.juli.FileHandler.level = FINE
#manager文件输出位置
3manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
#manager日志前缀为manager
3manager.org.apache.juli.FileHandler.prefix = manager.
 
#配置文件使host-manager日志输出级别为FINE
4host-manager.org.apache.juli.FileHandler.level = FINE
#host-manager文件输出位置
4host-manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
#host-manager日志前缀为host-manager
4host-manager.org.apache.juli.FileHandler.prefix = host-manager.
 
#配置文件使控制台日志输出级别为FINE
java.util.logging.ConsoleHandler.level = FINE
#控制台日志输出格式
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
#上面的输出格式类似:
#  四月 24, 2018 6:49:32 下午 org.apache.catalina.startup.Catalina start
#  信息: Server startup in 9772 ms
#比较丑,可以输出这种格式:24-Apr-2018 18:52:16.134 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 12631 ms
#java.util.logging.ConsoleHandler.formatter = org.apache.juli.OneLineFormatter
 
#localhost日志文件输出级别为INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = INFO
#localhost日志文件输出处理类2localhost.org.apache.juli.FileHandler
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers = 2localhost.org.apache.juli.FileHandler
 
#manager日志文件输出级别为INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].level = INFO
#manager日志文件输出处理类3manager.org.apache.juli.FileHandler
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].handlers = 3manager.org.apache.juli.FileHandler
 
#host-manager日志文件输出级别为INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].level = INFO
#host-manager日志文件输出处理类4host-manager.org.apache.juli.FileHandler
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].handlers = 4host-manager.org.apache.juli.FileHandler

你可能感兴趣的:(tomcat,tomcat日志详解)