views:

78

answers:

1

I'm running Tomcat in standalone mode. The "standalone" part is very important: I am not going to install Apache in front of Tomcat.

In my question here, about how to implement a "web bug", I got a great answer: http://stackoverflow.com/questions/3011876

However the answer states:

In your access logs, you can count for your jpg - the output should be"

127.0.0.1 - - [10/Jun/2010:11:38:53 +0530] "GET /mywebapp/jsp/invisible.jpg?1276150133362 HTTP/1.1" 200 991

But, as I feared, I cannot find such logs.

... $ cat apache-tomcat-6.0.26/logs/* | grep GET | wc -l

0

There are a lot of logs. My webapp's custom logs are definitely logged.

So I've got a few related questions:

  • Does "Tomcat standalone" log every HTTP GET request by default?

  • If yes, where are every HTTP GET requests logged by default? (how could I have found them myselves?)

  • If no, can "Tomcat standalone" be configured to log every HTTP GET request?

Note that I know that in my case I can add custom logging alongside with my web bug .jsp and search for that in the logs, but that is not my question here.

My question here is really about how Tomcat standalone (once again, the standalone is very important) deals with logging of all the HTTP GET requests.

+4  A: 

It doesn't log requests by default, but will do if you uncomment this valve in conf/server.xml:

<Valve className="org.apache.catalina.valves.AccessLogValve"
    directory="logs" prefix="localhost_access_log." suffix=".txt"
    pattern="common" resolveHosts="false"/>
Richard Fearn
Ha, beat me to the same answer by 30 secs. :-)
Greg Harman
@Richard Fearn: Thanks Richard and Greg, working perfectly... And I swear I *did* read all the *server.xml* but there's just so many stuff in there :)
NoozNooz42