cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicola Ken Barozzi" <baro...@nicolaken.com>
Subject Re: When to log exceptions
Date Wed, 19 Dec 2001 16:04:28 GMT

----- Original Message -----
From: "Carsten Ziegeler" <cziegeler@s-und-n.de>
To: "Cocoon-Dev" <cocoon-dev@xml.apache.org>
Sent: Wednesday, December 19, 2001 4:29 PM
Subject: [RT]: When to log exceptions


> Hi,
>
> I would like to know, if we should define a policy for logging exceptions.
> Currently, sometimes exceptions are logged when they are raised, sometimes
> when they are catched and sometimes they aren't logged at all.
>
> This leads to the problem, that you get the same exception more than once
> in the log or you never see it (ok, the first alternative is of course the
> better one );).
>
> Now, if we stick to a simple rule, we could easily have all exceptions in
> the log and these only once which would make reading the log files a
little
> bit easier. So, there are two alternatives:
> a) always log an exception when it's raised but not when it's catched
> b) always log an exception when it's catched but not when it's raised

c) make the exceptions implement the Notificable and CascadingException
interface and make the final catcher (CocoonServlet) log them before
sending them to the handle-errors pipline (the patch is almost ready,
please stand by ...).
The problem with logging exceptions is that in many parts of the code,
for at least some time, there were Exceptions logged and not properly
rethrown... "see the logs" is not acceptable on normal errors, they
must be handled and reported correctly in handle-errors.
So I propose to never log exceptions directly (CocoonServlet does) and
use logging only for extra reporting.

Does it make sense?

Nicola Ken Barozzi These are the days of miracle and wonder...
                                ...so don't cry baby, don't cry
<xml-cocoon@nicolaken.com>                          Paul Simon


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message