commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: [logging] are there standard logging practices?
Date Mon, 22 Jul 2002 22:20:44 GMT
Well...  I've gone round-and-round with this issue with folks on AXIS, but 
I'm always willing to defer to clearly stated experience!

I can agree with you 100% for libraries of tools & utils (beanutils, lang, 
collection, xerces, etc), but I think my recommendation should stand for 
runtime frameworks and middleware components such as AXIS.  Hopefully that 
would cut down on some of the excess logging.


Richard A. Sitze
IBM WebSphere WebServices Development

On Mon, 22 Jul 2002 wrote:

> Date: Mon, 22 Jul 2002 15:43:38 -0500
> From:
> Reply-To: Jakarta Commons Developers List 
> To: Jakarta Commons Developers List <>
> Subject: Re: [logging] are there standard logging practices?
> Done.  In particular, I have specific suggestions (my strong opinions 
> related to logging exceptions.


Thanks a bunch for taking the first shot at this; I think best practices
information will be very useful.  I've only got a couple of nits and one
topic that I'd like to explore a little further.

* Nit #1 - "boundry" --> "boundary"

* Nit #2 - There is sort of an implicit assumption that INFO is the
  default logging level that people should configure.  It would probably
  be appropriate to make that explicit.

The only thing I couldn't immediately buy into was the recommendation to
both log and rethrow exceptions under some circumstances.  I can see your
motivation for this (make sure there's an audit trail someplace), but my
experience has been that this usually causes the same exception to get
logged multiple times (by intermediate callers that do the same thing),
which creates quite a lot of bloat in the logs.

I've tended to *not* log exceptions thrown at the component level --
especially deliberate ones like a documented IllegalArgumentException for
invalid method parameters, but also for unplanned NPEs and such.  A
component caller can either log the exception and swallow it, or not log
and rethrow, as appropriate.  The potential problem with this approach, of
course, is that nobody ever logs it -- but presumably the outer wrapper
for your application will have suitable logic to catch and log anything
that ripples up that far.

What do you think?

> <ras>
> *******************************************
> Richard A. Sitze
> IBM WebSphere WebServices Development

Craig McClanahan

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message