gpt4 book ai didi

Tomcat 日志记录(如 apache)

转载 作者:行者123 更新时间:2023-11-28 22:09:58 25 4
gpt4 key购买 nike

我是 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

希望对您有所帮助。

关于Tomcat 日志记录(如 apache),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5861734/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com