tomcat 访问日志的问题

tomcat 访问日志的问题

我需要你的帮助。

我想在 SLES 12 上的 Apache Tomcat Web 服务器上记录访问。它运行正常且记录正常。但是当我访问该网站时,tomcat 会将 8 行写入 localhost_access_log.txt 文件。如下所示:

10.XXX.XX.XXX - - [27/Jul/2016:08:28:29 +0200] "GET / HTTP/1.1" 200 11250
10.XXX.XX.XXX - - [27/Jul/2016:08:28:29 +0200] "GET /tomcat.css HTTP/1.1" 200 5576
10.XXX.XX.XXX - - [27/Jul/2016:08:28:29 +0200] "GET /tomcat.png HTTP/1.1" 200 5103
10.XXX.XX.XXX - - [27/Jul/2016:08:28:29 +0200] "GET /favicon.ico HTTP/1.1" 200 21630
10.XXX.XX.XXX - - [27/Jul/2016:08:28:29 +0200] "GET /bg-nav.png HTTP/1.1" 200 1401
10.XXX.XX.XXX - - [27/Jul/2016:08:28:29 +0200] "GET /asf-logo.png HTTP/1.1" 200 17811
10.XXX.XX.XXX - - [27/Jul/2016:08:28:29 +0200] "GET /bg-middle.png HTTP/1.1" 200 1918
10.XXX.XX.XXX - - [27/Jul/2016:08:28:29 +0200] "GET /bg-button.png HTTP/1.1" 200 713
10.XXX.XX.XXX - - [27/Jul/2016:08:28:29 +0200] "GET /bg-upper.png HTTP/1.1" 200 3103
10.XXX.XX.XXX - - [27/Jul/2016:08:28:29 +0200] "GET /favicon.ico HTTP/1.1" 206 21630
10.XXX.XX.XXX - - [27/Jul/2016:08:28:29 +0200] "GET /favicon.ico HTTP/1.1" 200 21630

The same when I logged in as an admin, then tomcat write 5 lines.


10.XXX.XX.XXX - - [27/Jul/2016:10:37:01 +0200] "GET /manager/status HTTP/1.1" 401 2473
10.XXX.XX.XXX - admin [27/Jul/2016:10:37:02 +0200] "GET /manager/status HTTP/1.1" 200 7010
10.XXX.XX.XXX - - [27/Jul/2016:10:37:03 +0200] "GET /manager/images/tomcat.gif HTTP/1.1" 200 2066
10.XXX.XX.XXX - - [27/Jul/2016:10:37:03 +0200] "GET /manager/images/asf-logo.gif HTTP/1.1" 200 7279
10.XXX.XX.XXX - - [27/Jul/2016:10:37:03 +0200] "GET /favicon.ico HTTP/1.1" 200 21630

现在我的问题是:

每次访问只写一行可以吗tomcat?或者以个人格式写入日志?因为我想用graylog2分析访问日志,而graylog2在这方面有些问题。

相关内容