【Tomcat】tomcat logs 目录下各日志文件的含义
淩度奢望 ✦ 暂无邮箱
  tomcat每次启动时,自动在logs目录下生产以下日志文件,按照日期自动备份。可以帮助我们更好的找出错误。
 
一、  认识各种目录的作用及记录的信息
目录


 
1.catalina.日期.log
  这个主要是记录tomcat启动时候的信息,类似于我们在eclipse中启动服务的时候在控制台看到的信息。在里面可以看到启动的JVM参数以及操作系统等日志信息。如果没有使用log4j等日志机制,系统的的错误信息与打印语句也在这个日志文件中记录。(linux下所有的日志都在catalina.out中)
例如:
十二月 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.
十二月 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.
十二月 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.
十二月 14, 2017 11:04:27 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server version:        Apache Tomcat/7.0.72
十二月 14, 2017 11:04:27 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server built:          Sep 14 2016 12:12:26 UTC
十二月 14, 2017 11:04:27 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server number:         7.0.72.0
十二月 14, 2017 11:04:27 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Name:               Windows 8
十二月 14, 2017 11:04:27 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Version:            6.2
十二月 14, 2017 11:04:27 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Architecture:          amd64
十二月 14, 2017 11:04:27 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Java Home:             C:\Program Files\Java2\jdk1.7.0_80\jre
十二月 14, 2017 11:04:27 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Version:           1.7.0_80-b15
十二月 14, 2017 11:04:27 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Vendor:            Oracle Corporation
十二月 14, 2017 11:04:27 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_BASE:         E:\tomcat\apache-tomcat-7.0.72
十二月 14, 2017 11:04:27 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_HOME:         E:\tomcat\apache-tomcat-7.0.72
十二月 14, 2017 11:04:27 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.home=E:\tomcat\apache-tomcat-7.0.72
十二月 14, 2017 11:04:27 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.base=E:\tomcat\apache-tomcat-7.0.72
十二月 14, 2017 11:04:27 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.endorsed.dirs=E:\tomcat\apache-tomcat-7.0.72\endorsed
十二月 14, 2017 11:04:27 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.io.tmpdir=E:\tomcat\apache-tomcat-7.0.72\temp
十二月 14, 2017 11:04:27 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
十二月 14, 2017 11:04:28 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.util.logging.config.file=E:\tomcat\apache-tomcat-7.0.72\conf\logging.properties
十二月 14, 2017 11:04:28 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: exit
十二月 14, 2017 11:04:28 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Xms3500m
十二月 14, 2017 11:04:28 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Xmx3500m
十二月 14, 2017 11:04:28 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Xss1024k
十二月 14, 2017 11:04:28 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: Loaded APR based Apache Tomcat Native library 1.2.8 using APR version 1.5.2.
十二月 14, 2017 11:04:28 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
十二月 14, 2017 11:04:29 下午 org.apache.catalina.core.AprLifecycleListener initializeSSL
信息: OpenSSL successfully initialized (OpenSSL 1.0.2h  3 May 2016)
十二月 14, 2017 11:04:29 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-nio-80"]
十二月 14, 2017 11:04:29 下午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
信息: Using a shared selector for servlet write/read
十二月 14, 2017 11:04:29 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["ajp-apr-8009"]
十二月 14, 2017 11:04:29 下午 org.apache.catalina.startup.Catalina load
信息: 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.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.

 

 

3.host-manager.日期.log
  这个估计是放tomcat的自带的manager项目的日志信息的,也没有看到有什么重要的日志信息
4.localhost.日期.log
  这个类似于第一种日志,可是信息没有第一种全
5.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

 

6.manager.日志.log
  这个估计也是manager项目专有的日志文件,看不出有什么重要的信息
7.tomcat7-stderr.日期.log  
  这个是log4j的错误日志,因此在程序中要合理的捕捉异常。
8.tomcat7-stdout.日期.log  (类似于eclipse的控制台的信息)
  这个是程序中的System语句打印的日志(包括系统抛出的异常),也终于明白了为什么一再强调不能用打印语句进行系统调试
Submit
no comments yet~