This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I need the log where tomcat puts 404 type errors.
I am using: tomcat 6 on Centos 5.2
I have been getting 404 errors in applications deployed on tomcat. I was unable to find the logs where tomcat puts messages when it is unable to find requested files and other simple errors.
- I am not talking about stuff logged by applications, just 404 type stuff.
I checked <tomcat>/logs and found following types of files
catalina.out : contains startup and shutdown messages (mostly INFO messages)
catalina.<year-mm-dd>.log : contains same data as above file for its date
host-manager.year-mm-dd.log : empty (Seems to be meant for tomcat manger, I have not been using that)
localhost.year-mm-dd.log : some application related log message (org.apache.catalina.core.ApplicationContext... INFO messages)
manager.year-mm-dd.log : empty
So, none of these contain the 404 errors. Since I installed tomcat by simply unpacking it in /usr/share I'm pretty sure it has no logs in /var/log (I checked and nothing for catlina or tomcat).
Joined: Jul 22, 2010
I thought maybe the problem is not of finding the log but making tomcat log these errors. So I tried the following
I searched and found that a valve can be configured in <tomcat>/conf/server.xml for similar purposes but I only able to log incoming request.
This created the file <tomcat>/logs/localhost_access_log.txt which contains details of requests coming in e.g.
Still I could not get the 404 file not found errors in log.
Can anyone tell me how to get tomcat to log its 404 error and where to find them. I remember apache logs contain the requested url, path of local file searched for and not found and that a 404 has been sent - all in the same message. For starters I am most interested in the "path of local file searched for and not found" part.