tomcat日志信息查看

不要老只看 start in xxx ms 后的信息,有时在部署项目时可能就出错了呢?

按照下面这样子做,会使用tomcat输出的错误信息更为详细

在WEB-INF/classes目录下新建一个名为 logging.properties 文件,该文件内容如下:

handlers = org.apache.juli.FileHandler, java.util.logging.ConsoleHandler

############################################################
# Handler specific properties.
# Describes specific configuration info for Handlers.
############################################################

org.apache.juli.FileHandler.level = FINE
org.apache.juli.FileHandler.directory = ${catalina.base}/logs
org.apache.juli.FileHandler.prefix = servlet-examples.

java.util.logging.ConsoleHandler.level = FINE
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter

这样在启动tomcat的时候就会在logs目录下生成一个error-debug.xxx.log文件,该文件会详细描述错误信息的。

也在catalina.xxx.log日志下出错里给出更详尽的错误信息描述,对于查错究极有用!!!

我是从这里知道的:http://xpenxpen.iteye.com/blog/1545648

这是 tomcat 官方关于logging的文档描述

http://tomcat.apache.org/tomcat-7.0-doc/logging.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章