> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> I usually do what Yoav described.
Me too.
We used the following guidelines to cleanup our logging mess. We had
things being logged multiple times etc. This among other things is
what actually got me interested in
IL PROTECTED]
> Sent: Wednesday, March 17, 2004 9:00 AM
> To: Log4J Users List
> Subject: RE: RE: when to log Exceptions
>
>
>
> Hi,
>
> >Exceptions are often caught and rethrown.
>
> If you're the end of the catching chain, i.e. if you don't r
you will have only one log for each error but the code might be
> harder
> to maintain.
>
> Raz.
>
> -Original Message-
> From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, March 17, 2004 9:00 AM
> To: Log4J Users List
> Subject: RE: RE: when to log Exceptions
Hi,
>I agree with this approach. The only drawback is that you might need to
>duplicate your logging code. For example : MethodA and MethodB both
call
>MethodC. MethodC finds an error and throw an exception. Then both
MethodA
>and MethodB will need to log this error. And what if you have 50
metho
Hi,
>I guess I don't trust other team members who might be writing the code
at
>the end of that chain to be as dilligent as myself in logging.
>
>I would only trust this if something like checkstyle could enforce.
You've got other team problems that are beyond the scope of this
discussion or thi
er
to maintain.
Raz.
-Original Message-
From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 17, 2004 9:00 AM
To: Log4J Users List
Subject: RE: RE: when to log Exceptions
Hi,
>Exceptions are often caught and rethrown.
If you're the end of the catching chain, i.e.
te: 2004/03/17 Wed PM 02:00:26 GMT
> To: "Log4J Users List" <[EMAIL PROTECTED]>
> Subject: RE: RE: when to log Exceptions
>
>
> Hi,
>
> >Exceptions are often caught and rethrown.
>
> If you're the end of the catching chain, i.e. if you don't
ception is logged - but beware of big log files ;-)
Regards,
Torben
-UrsprÃngliche Nachricht-
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Gesendet: Mi 17.03.2004 14:55
An: Log4J Users List
Cc:
Betreff: Re: RE: when to log
Hi,
>Exceptions are often caught and rethrown.
If you're the end of the catching chain, i.e. if you don't rethrow it,
log it. If you do rethrow it, no need to log because you're not really
handling the exception. This approach is easy and will work with
external libraries as well, without havi
ag in the exception although I've previously
considered that exceptions should be immutable.
Bob.
>
> From: "Shapira, Yoav" <[EMAIL PROTECTED]>
> Date: 2004/03/17 Wed PM 01:48:18 GMT
> To: "Log4J Users List" <[EMAIL PROTECTED]>
> Subje
Hi,
I'd offer an extremely simple but usually highly effective heuristic:
log it when it's caught. View logging as part of the handling of an
exception.
Yoav Shapira
Millennium Research Informatics
>-Original Message-
>From: Larry Young [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, March 1
> Where would you see as being the best place to log this
> Exception? If it gets logged at the lowest layer (methodC), how does the
> next layer up (methodB) know not to log it again, since it can't tell
which
> Exceptions it caused and which were thrown to it. And the same question
"
in this realm (exception handling, etc.).
Mike
-Original Message-
From: Larry Young [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 17, 2004 12:09 AM
To: Log4J Users List
Subject: RE: when to log Exceptions
Mike,
Yes, I had thought of something quite similar to that
a
Mike,
Yes, I had thought of something quite similar to that
approach. But instead of deciding to log by class type, I had planned on
having a simple "boolean hasBeenLogged" in the base Exception class and my
logging wrapper class would simply check that flag before doing any work,
and
Interesting question, should result in some good conversation!
One approach is to create your own exception type and if you catch that,
you'll know somewhere below you logged it (by convention). If you catch a
Java exception, you'll know it hasn't been logged yet.
I'm interested to see what tr
15 matches
Mail list logo