wood burning stoves 2.0*
The moose likes Tomcat and the fly likes Error logging in Tomcat 5.5 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Error logging in Tomcat 5.5" Watch "Error logging in Tomcat 5.5" New topic
Author

Error logging in Tomcat 5.5

Charles McGuire
Ranch Hand

Joined: Jan 18, 2005
Posts: 99
I'm struggling to understand error logging in 5.5. As per the instructions at http://tomcat.apache.org/tomcat-5.5-doc/logging.html, I've configured my log4j properties file and set up the log4j.jar and commons-logging-1.1.jar files in the common\lib.

The logging seems to work fine. I can switch the log levels from WARN to DEBUG and vary the granularity of the messages. I can see the messages on startup and shutdown.

For example, whenever I type anything into my browser, I can't see any result in the logs. A simple .html page is served up fine, but a 405 error message (HTTP method GET is not supported by this URL) that displays to the screen cannot be found anywhere in the logs. (I'm working on an XML-RPC project).

1) Is there a good resource on Tomcat J2EE development that you can recommend? I'd hate to abuse these boards with newbie problems.

2) As long as I'm posting, does anyone have any suggestions for me for logging? I'd like to see all requests in a log someplace. My log4j.properties file that is in my common\classes folder is as follows:


Thank you...!


There's no place like 127.0.0.1
steve souza
Ranch Hand

Joined: Jun 26, 2002
Posts: 861
I haven't configured log4j in tomcat, but here are a few links I found. Search for tomcat in the links for more info:

http://logging.apache.org/log4j/docs/manual.html
http://tomcat.apache.org/faq/logging.html#commonsLoggingConfiguration


http://www.jamonapi.com/ - a fast, free open source performance tuning api.
JavaRanch Performance FAQ
Charles McGuire
Ranch Hand

Joined: Jan 18, 2005
Posts: 99
Thanks for the links, but I already tried those.

Since my post, I discovered that what I want is something called the Valve Component. Click on Tomcat 5.5 Valve Component for reference, but I need it broken down and explained to me like a two year old.

I ordered a Tomcat 5.5 book - should arrive today - that I'm hoping will help me with these issues.

Thanks again for your post.
steve souza
Ranch Hand

Joined: Jun 26, 2002
Posts: 861
My next release of jamon will come with a valve that tracks statistics for tomcat. They are pretty easy to write. Essentially one method that intercepts all page requests that go to tomcat. With this you can track the error code, page performance etc or log things. Here is my code. Note they changed the way valves work from tomcat 5 to 5.5.

You wrap the code you want to do around this code.


Here is a sample



[ September 05, 2007: Message edited by: steve souza ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error logging in Tomcat 5.5