开发者

Tomcat logging (like apache)

I am a novice to Tomcat and tried to find an answer from this forum and web but haven't been very successful so here I am.

I would li开发者_开发技巧ke to leave every visit to my tomcat server including referral, browser info and so on which I think I get from Apache (by default?). Is there a way to do that in tomcat (preferrably just by turning on some option). I looked at the logs directory of my tomcat installation but I can't find anything similar to what I am looking for.


If I understand correctly, check here: http://wiki.apache.org/tomcat/FAQ/Logging#Q1

From the 3rd bullet point, of the first question:

 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

Hope that helps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜