> -----Message d'origine-----
> De: Andrew Hill [mailto:[EMAIL PROTECTED]]
> Date: lundi 27 janvier 2003 16:19
> À: Struts Users Mailing List
> Objet: RE: Logging
> 
> 
> Struts comes with a marvellous package known as 
> commons-logging - which is
> what struts uses to output log messages.
> Commons logging info may be found at:
> http://jakarta.apache.org/commons/logging.html
> Its not actually a logger itself, but rather an api that allows you to
> change the logger you use without changing your code. (It 
> does for logging
> what jaxp does for xml parsing...).
> 
> Its easy to use - for example:
> (I mean really really easy. It took me five minutes to work 
> out how to use
> it!)
> 
> Log log = LogFactory.getLog(this.getClass());
> if(log.isInfoEnabled())
> {
>   log.info("My dog is inside the piano");
> }
> 
> etc...
> 
> catch(StuckDogException ex)
> {
>   if(log.isErrorEnabled())
>   {
>     log.error("I think he is stuck in there",ex);
>   }
> }

The if (log.isXXXEnabled) is really necessary?
You cannot filter depending on the log level, at application level?

This e-mail is intended only for the above addressee. It may contain
privileged information. If you are not the addressee you must not copy,
distribute, disclose or use any of the information in it. If you have
received it in error please delete it and immediately notify the sender.
Security Notice: all e-mail, sent to or from this address, may be
accessed by someone other than the recipient, for system management and
security reasons. This access is controlled under Regulation of
Investigatory Powers Act 2000, Lawful Business Practises.

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

Reply via email to