Click to See Complete Forum and Search --> : Configuring tomcat logging - how to skip some exceptions?


Setomidor
10-18-2007, 03:33 AM
Morning

In my web application, I use exceptions and error-pages to deal with for instance when a user tries to POST the same data again (using a randomfield as control number). This works like a charm with one exception: my logs are cluttered with stack traces!

What I want to do is shut of logging for any exception that has a designated error-page configured in web.xml. Exceptions that are displayed to the user with a default tomcat error page should still be logged for future patching.

Can this be done? Even specifying which specific classes that are affected is a durable solutions (they're not more then 5 anyway).

Thanks in advance!

//Seto

Justin
10-27-2007, 01:29 AM
I have no idea but are you catching the errors? If you produce output on err.out then i think that goes into the logs but i could be wrong... i don't have much experience with it but i would think if you catch the error and prevent it from going to the err.out i would think it wouldn't be logged.

slaughters
10-30-2007, 10:33 AM
Are you using Log4j for your logging: http://logging.apache.org/log4j/1.2/index.html ?

If so you can turn it off/on based on what severity level you wish to see by simply modifying a config file.