Kee
Kee

Reputation: 11

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 like 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.

Upvotes: 1

Views: 436

Answers (1)

clmarquart
clmarquart

Reputation: 4711

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.

Upvotes: 3

Related Questions