linux中tomcat日志文件含义

tomcat每次启动时,自动在logs目录下生产以下日志文件,按照日期自动备份。可以帮助我们更好的找出错误。

一、 认识各种目录的作用及记录的信息

1.catalina.日期.log

  • 这个主要是记录tomcat启动时候的信息,类似于我们在IDEA中启动服务的时候在控制台看到的信息。在里面可以看到启动的JVM参数以及操作系统等日志信息。

注意:如果没有使用log4j等日志机制,系统的的错误信息与打印语句也在这个日志文件中记录。

例如:

十二月 14, 2017 11:04:27 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'debug' to '0' did not find a matching property.
信息: Initialization processed in 5531 ms
十二月 14, 2017 11:04:29 下午 org.apache.catalina.core.StandardService startInternal
信息: Starting service Catalina
十二月 14, 2017 11:04:30 下午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/7.0.72
十二月 14, 2017 11:04:31 下午 org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom
信息: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [367] milliseconds.
十二月 14, 2017 11:04:32 下午 org.apache.catalina.startup.HostConfig deployDescriptor
信息: Deploying configuration descriptor E:\tomcat\apache-tomcat-7.0.72\conf\Catalina\localhost\Exam.xml
十二月 14, 2017 11:04:32 下午 org.apache.catalina.startup.SetContextPropertiesRule begin
警告: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Exam' did not find a matching property.
十二月 14, 2017 11:04:42 下午 org.apache.catalina.startup.TldConfig execute
信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
十二月 14, 2017 11:05:01 下午 org.apache.catalina.startup.HostConfig deployDescriptor
信息: Deployment of configuration descriptor E:\tomcat\apache-tomcat-7.0.72\conf\Catalina\localhost\Exam.xml has finished in 29,545 ms
十二月 14, 2017 11:05:01 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory E:\tomcat\apache-tomcat-7.0.72\webapps\docs
十二月 14, 2017 11:05:02 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory E:\tomcat\apache-tomcat-7.0.72\webapps\docs has finished in 227 ms
十二月 14, 2017 11:05:02 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory E:\tomcat\apache-tomcat-7.0.72\webapps\examples
十二月 14, 2017 11:05:02 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory E:\tomcat\apache-tomcat-7.0.72\webapps\examples has finished in 659 ms
十二月 14, 2017 11:05:02 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory E:\tomcat\apache-tomcat-7.0.72\webapps\host-manager
十二月 14, 2017 11:05:02 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory E:\tomcat\apache-tomcat-7.0.72\webapps\host-manager has finished in 192 ms
十二月 14, 2017 11:05:02 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory E:\tomcat\apache-tomcat-7.0.72\webapps\manager
十二月 14, 2017 11:05:03 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory E:\tomcat\apache-tomcat-7.0.72\webapps\manager has finished in 134 ms
十二月 14, 2017 11:05:03 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory E:\tomcat\apache-tomcat-7.0.72\webapps\ROOT
十二月 14, 2017 11:05:03 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory E:\tomcat\apache-tomcat-7.0.72\webapps\ROOT has finished in 106 ms
十二月 14, 2017 11:05:03 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-nio-80"]
十二月 14, 2017 11:05:03 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-apr-8009"]
十二月 14, 2017 11:05:03 下午 org.apache.catalina.startup.Catalina start
信息: Server startup in 33450 ms

2.catalina.out

  • linux下所有的日志都在catalina.out中

3.commons-daemon.日期.log

  • 这个日期放的估计是利用服务方式启动tomcat作为守护进程的日志记录,因为我的tomcat启动方式是以服务的方式启动的,索引产生这个日志文件记录了服务的启动状态。
[2017-12-16 15:45:49] [info]  [1706572] Commons Daemon procrun (1.0.15.0 64-bit) started
[2017-12-16 15:45:49] [info]  [1706572] Running 'Tomcat7' Service...
[2017-12-16 15:45:49] [info]  [1706632] Starting service...
[2017-12-16 15:45:51] [info]  [1706632] Service started in 1617 ms.
[2017-12-16 15:50:57] [info]  [1716024] Stopping service...
[2017-12-16 15:50:58] [info]  [1716024] Service stop thread completed.
[2017-12-16 15:50:59] [info]  [1706572] Run service finished.
[2017-12-16 15:50:59] [info]  [1706572] Commons Daemon procrun finished
[2017-12-16 15:51:21] [info]  [1711056] Commons Daemon procrun (1.0.15.0 64-bit) started
[2017-12-16 15:51:22] [info]  [1711056] Running 'Tomcat7' Service...
[2017-12-16 15:51:22] [info]  [1716072] Starting service...
[2017-12-16 15:51:23] [info]  [1716072] Service started in 1511 ms.

4.host-manager.日期.log

  • 这个估计是放tomcat的自带的manager项目的日志信息的,也没有看到有什么重要的日志信息

5.localhost.日期.log

  • 这个类似于第一种日志,可是信息没有第一种全

6.localhost_access_log.日期.txt

  • 这个是存放访问tomcat的请求的所有地址以及请求的路径、时间,请求协议以及返回码等信息(重要)

例如:

0:0:0:0:0:0:0:1 - - [14/Dec/2017:23:24:03 +0800] "GET /Exam/image/newsLogo.jpg HTTP/1.1" 304 -
0:0:0:0:0:0:0:1 - - [14/Dec/2017:23:24:06 +0800] "POST /Exam/train_findStudyTraincontentByFy.action HTTP/1.1" 200 25
0:0:0:0:0:0:0:1 - - [14/Dec/2017:23:24:06 +0800] "POST /Exam/newsIP_getTypeNews.action HTTP/1.1" 200 258
0:0:0:0:0:0:0:1 - - [14/Dec/2017:23:24:06 +0800] "POST /Exam/newsIP_getTypeNews.action HTTP/1.1" 200 2338

7.manager.日志.log

  • 这个估计也是manager项目专有的日志文件,看不出有什么重要的信息

8.tomcat7-stderr.日期.log

  • 这个是log4j的错误日志,因此在程序中要合理的捕捉异常。

9.tomcat7-stdout.日期.log (类似于eclipse的控制台的信息)

  • 这个是程序中的System语句打印的日志(包括系统抛出的异常),也终于明白了为什么一再强调不能用打印语句进行系统调试
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值