File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes Unable to make tomcat log 404 type error messages. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Unable to make tomcat log 404 type error messages." Watch "Unable to make tomcat log 404 type error messages." New topic
Author

Unable to make tomcat log 404 type error messages.

sun neel
Greenhorn

Joined: Jul 22, 2010
Posts: 4
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).
Any ideas?

Thanks

sun neel
Greenhorn

Joined: Jul 22, 2010
Posts: 4
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.
sun neel
Greenhorn

Joined: Jul 22, 2010
Posts: 4
I read about <tomcat>/conf/logging.properties
http://tomcat.apache.org/tomcat-6.0-doc/logging.html
It seems to be more relevant to logging done inside applications, still I set catalina logging to FINEST with:

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.

Misha Ver
Ranch Hand

Joined: Mar 03, 2008
Posts: 470
Why you do not like this line? It looks like 404 error for me

sun neel
Greenhorn

Joined: Jul 22, 2010
Posts: 4
Misha the line contains the request url

I need the the path of file that was searched for and not found.

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Unable to make tomcat log 404 type error messages.
 
Similar Threads
help configuring log4j properties file to mirror java.util.logging (juli) already in place
Where is logging file stored?
A question about log-rotation on "catalina.out"
logs with Tomcat 5.5.9
Problem accessing jsp Page