struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From René Eigenheer <reigenh...@bridgesolutions.net>
Subject RE: Best Practices for Logging?
Date Fri, 06 Dec 2002 22:08:26 GMT
Laird and Justin

thanks for your replies - do you put the condition only for log.debug or for
all levels of logging as the performance issue is valid for all of them?

thanks
rene

> -----Original Message-----
> From: Justin Ashworth [mailto:justin-struts@ashworth.org]
> Sent: Freitag, 6. Dezember 2002 22:54
> To: Struts Users Mailing List
> Subject: Re: Best Practices for Logging?
>
>
> Hi Rene,
>
> Whether or not you put an if condition around the log output
> is mostly a
> consideration of the performance required by your
> application, since even
> one simple String creation takes longer than no String
> creation. :)  In
> addition, it is nice to be able to call isDebugEnabled() if
> you want to do
> some additional processing (regardless of debug output) when
> you're in debug
> mode.  For instance, if you want to gather more detailed
> statistics in debug
> mode you would put that logic within the if condition.
>
> HTH,
>
> Justin
>
> ----- Original Message -----
> From: "Rene Eigenheer" <reigenheer@bridgesolutions.net>
> To: "'Struts Users Mailing List'" <struts-user@jakarta.apache.org>
> Sent: Friday, December 06, 2002 4:47 PM
> Subject: RE: Best Practices for Logging?
>
>
> > another question for best practice:
> >
> > I often see debug messages code like:
> >
> > if (log.isDebugEnabled() {
> >    log.debug("debug message");
> > }
> >
> >
> > and sometimes:
> > log.debug("debug message");  // let the log class decide
> whether it has to
> > do debug
> >
> > which of the two versions do you prefer - why?
> >
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:struts-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> <mailto:struts-user-help@jakarta.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:
> <mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:struts-user-help@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message