网站建设资讯

NEWS

网站建设资讯

【CentOS7Tomcat配置5】,Tomcat日志#180121

hellopasswd

十载的潮阳网站建设经验,针对设计、前端、开发、售后、文案、推广等六对一服务,响应快,48小时及时工作处理。成都营销网站建设的优势是能够根据用户设备显示端的尺寸不同,自动调整潮阳建站的显示方式,使网站能够适用不同显示终端,在浏览器中调整网站的宽度,无论在任何一种浏览器上浏览网站,都能展现优雅布局与设计,从而大程度地提升浏览体验。创新互联建站从事“潮阳网站设计”,“潮阳网站推广”以来,每个客户项目都认真落实执行。

Tomcat日志 ls /usr/local/tomcat/logs 其中catalina开头的日志为tomcat的综合日志,他记录tomcat服务相关信息,也会记录错误日志 其中catalina.日期.log和catalina.out内容相同,前者会每天生成一个新的日志 host-manager和manager为管理相关的日志,其中host-manager为虚拟主机的管理日志 localhost和localhost_access为虚拟主机相关日志,其中带access字样的日志为访问日志,不带access字样的为默认虚拟主机的错误日志 访问日志默认不会生成,需要server.xml中配置一下

[root@localhost ~]# ls /usr/local/tomcat/logs/ catalina.2018-01-17.log host-manager.2018-01-17.log localhost.2018-01-21.log manager.2018-01-17.log catalina.2018-01-21.log host-manager.2018-01-21.log localhost_access_log.2018-01-17.txt manager.2018-01-21.log catalina.out localhost.2018-01-17.log localhost_access_log.2018-01-21.txt [root@localhost ~]# cd !$ cd /usr/local/tomcat/logs/

综合日志 catalina.out

[root@localhost logs]# tail catalina.out 21-Jan-2018 08:33:02.036 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-80"] Jan 21, 2018 8:33:02 AM com.fzb.zrlog.plugin.server.impl.NioServer create INFO: plugin listening on port -> 47381 Jan 21, 2018 8:33:02 AM com.fzb.zrlog.plugin.server.impl.NioServer create INFO: load jar files 21-Jan-2018 08:33:02.160 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"] 21-Jan-2018 08:33:02.171 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 58666 ms INFO 2018-01-21 08:33:02,737 - {"downloadUrl":"http://dl.zrlog.com/release/zrlog-1.8.0-d1f36bc-release.war","type":"正式版","version":"1.8.0","buildId":"d1f36bc","fileSize":7306860,"releaseDate":"2017-12-12 01:32:01+08:00"} www.123.cn INFO 2018-01-21 08:33:05,462 - ZrLog New update found new [1.8.0-d1f36bc]

catalina.日期.log

[root@localhost logs]# tail catalina.2018-01-21.log 21-Jan-2018 08:33:01.982 INFO [www.123.cn-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/logs] has finished in [10] ms 21-Jan-2018 08:33:01.982 INFO [www.123.cn-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/temp] 21-Jan-2018 08:33:01.991 INFO [www.123.cn-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/temp] has finished in [9] ms 21-Jan-2018 08:33:01.991 INFO [www.123.cn-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps] 21-Jan-2018 08:33:02.000 INFO [www.123.cn-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps] has finished in [8] ms 21-Jan-2018 08:33:02.000 INFO [www.123.cn-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/work] 21-Jan-2018 08:33:02.009 INFO [www.123.cn-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/work] has finished in [9] ms 21-Jan-2018 08:33:02.036 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-80"] 21-Jan-2018 08:33:02.160 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"] 21-Jan-2018 08:33:02.171 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 58666 ms

管理相关的日志 manager.20xx-xx-xx.log

[root@localhost logs]# tail manager.2018-01-21.log

host-manager.20xx-xx-xx.log

[root@localhost logs]# tail host-manager.2018-01-21.log

默认为空

虚拟主机相关日志 localhost.日期.log

[root@localhost logs]# tail localhost.2018-01-21.log ... 26 more 21-Jan-2018 08:26:53.705 INFO [localhost-startStop-3] org.apache.catalina.core.ApplicationContext.log SessionListener: contextDestroyed() 21-Jan-2018 08:26:53.705 INFO [localhost-startStop-3] org.apache.catalina.core.ApplicationContext.log ContextListener: contextDestroyed() 21-Jan-2018 08:27:00.265 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log ContextListener: contextInitialized() 21-Jan-2018 08:27:00.266 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log SessionListener: contextInitialized() 21-Jan-2018 08:31:58.772 INFO [localhost-startStop-2] org.apache.catalina.core.ApplicationContext.log SessionListener: contextDestroyed() 21-Jan-2018 08:31:58.773 INFO [localhost-startStop-2] org.apache.catalina.core.ApplicationContext.log ContextListener: contextDestroyed() 21-Jan-2018 08:33:00.420 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log ContextListener: contextInitialized() 21-Jan-2018 08:33:00.420 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log SessionListener: contextInitialized()

localhost_access_log.日期.txt

[root@localhost logs]# tail localhost_access_log.2018-01-21.txt 192.168.9.1 - - [21/Jan/2018:08:30:24 +0800] "GET / HTTP/1.1" 404 - 192.168.9.1 - - [21/Jan/2018:08:30:24 +0800] "GET /favicon.ico HTTP/1.1" 404 - 192.168.9.1 - - [21/Jan/2018:08:30:25 +0800] "GET / HTTP/1.1" 404 - 192.168.9.1 - - [21/Jan/2018:08:30:25 +0800] "GET /favicon.ico HTTP/1.1" 404 - 192.168.9.1 - - [21/Jan/2018:08:30:26 +0800] "GET /favicon.ico HTTP/1.1" 404 - 192.168.9.1 - - [21/Jan/2018:08:30:27 +0800] "GET / HTTP/1.1" 404 - 192.168.9.1 - - [21/Jan/2018:08:30:27 +0800] "GET /favicon.ico HTTP/1.1" 404 - 192.168.9.1 - - [21/Jan/2018:08:30:29 +0800] "GET / HTTP/1.1" 404 - 192.168.9.1 - - [21/Jan/2018:08:30:45 +0800] "GET / HTTP/1.1" 404 - 192.168.9.1 - - [21/Jan/2018:08:30:51 +0800] "GET / HTTP/1.1" 404 - 具体方法是对应虚拟主机的里面加入下面的配置(假如域名为123.cn): prefix定义访问日志的前缀,suffix定义日志的后缀,pattern定义日志格式。新增加的虚拟主机默认并不会生成类似默认主机的localhost.日期.log日志,错误日志会统一记录到catalina.out中。 关于tomcat日志,最需要关注catalina.out,当出现问题时,应该第一次时间去查看它。



分享名称:【CentOS7Tomcat配置5】,Tomcat日志#180121
分享URL:http://cdweb.net/article/cpiogd.html