• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Error logging in Tomcat 5.5

 
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...!
 
Ranch Hand
Posts: 862
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Charles McGuire
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 862
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Men call me Jim. Women look past me to this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic