【发布时间】:2011-05-02 19:46:03
【问题描述】:
我是 Tomcat 的新手,并试图从这个论坛和网络上找到答案,但不是很成功,所以我在这里。
我想留下对我的 tomcat 服务器的每次访问,包括我认为我从 Apache 获得的推荐、浏览器信息等(默认情况下?)。有没有办法在 tomcat 中做到这一点(最好只是通过打开某个选项)。我查看了我的 tomcat 安装的日志目录,但找不到与我要查找的内容相似的任何内容。
【问题讨论】:
我是 Tomcat 的新手,并试图从这个论坛和网络上找到答案,但不是很成功,所以我在这里。
我想留下对我的 tomcat 服务器的每次访问,包括我认为我从 Apache 获得的推荐、浏览器信息等(默认情况下?)。有没有办法在 tomcat 中做到这一点(最好只是通过打开某个选项)。我查看了我的 tomcat 安装的日志目录,但找不到与我要查找的内容相似的任何内容。
【问题讨论】:
如果我理解正确,请查看:http://wiki.apache.org/tomcat/FAQ/Logging#Q1
从第一个问题的第 3 个要点开始:
To enable request logging similar to the Apache HTTP server, you may include the
following line in the server.xml file, in the <Engine> tag:
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs" prefix="localhost_access_log." suffix=".log"
pattern="common" resolveHosts="false"/>
This will produce a log file for each day, such as
logs/localhost_access_log.2008-03-10.log, containing the files
requested, IP address of the requester, and similar information.
128.34.123.121 - - [10/Mar/2008:15:55:57 -0500] "GET /upload/ClickPoints.jsp HTTP/1.1" 200 2725
希望对您有所帮助。
【讨论】: