On Tue, 23 Jul 2002, Mark O'Driscoll wrote:

> Date: Tue, 23 Jul 2002 18:18:42 +0100
> From: Mark O'Driscoll <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: Tomcat Users List <[EMAIL PROTECTED]>
> Subject: Is there any way to stop exceptions getting logged to log file?
>
> I am using a filter to trap exceptions thrown by jsps/servlets. In normal
> program operation, lots of these exceptions get thrown.
> In order to stop 'localhost_log.YYYY-MM-DD.txt' getting clogged, I'd like to
> stop exceptions that are handled by the servlet engine from being logged.
> Or at least ust havethe exception mentioned rather than the full stack
> trace.
>

To avoid the exceptions getting logged, you'll need to catch them in the
servlet or JSP itself (which is a much better programming practice than
letting them flow through), so that the servlet container never sees them.
Exceptions from servlets and JSPs should not be considered "normal" --
they are an indication of an error condition that the application should
have taken care of, but did not.

To change how much gets logged when an exception is caught by Tomcat,
you'll need to modify the Tomcat sources.

Craig


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to