File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes Tomcat 404 - how to log bad url? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat 404 - how to log bad url?" Watch "Tomcat 404 - how to log bad url?" New topic

Tomcat 404 - how to log bad url?

M Conlin

Joined: Aug 01, 2005
Posts: 15
I want to capture the bad URL when a 404 is thrown.

The only way I do this so far is to have the tomcat set to DEBUG, this creates a HUGE amount of logging.

Are there any other ways to get this information... when the URL is bad I want to see what it was they wanted.
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

If you turn on access logging (uncomment its entry in server.xml) you'll have a typical log that can be parsed with programs like webalizer.
This has log entries for every hit, including the response code.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: Tomcat 404 - how to log bad url?
It's not a secret anymore!