I wasn't sure if it was good to encourage someone
using another classes logger because it might make the
logs harder to read and control.  So I didn't add
access for the logger.  And you do still have access
to the servlet log.

I agree with Craig.  I think it is good form to define
your own logger so you can control log levels and
loggers/appenders based package names.  It works out
very nicely.  You can have a master log, all
org.apache.struts go to another, and have your source
log one too (or whatever you want).

David

--- "Craig R. McClanahan" <[EMAIL PROTECTED]> wrote:
> 
> 
> On Tue, 5 Mar 2002, Oleg V Alexeev wrote:
> 
> > Date: Tue, 5 Mar 2002 10:43:15 +0300
> > From: Oleg V Alexeev <[EMAIL PROTECTED]>
> > Reply-To: Struts Developers List
> <[EMAIL PROTECTED]>,
> >      Oleg V Alexeev <[EMAIL PROTECTED]>
> > To: Struts Developers List
> <[EMAIL PROTECTED]>
> > Subject: Logger in ActionServlet
> >
> > Hello Struts,
> >
> >   Log variable in ActionServlet is private and get
> method to obtain it
> >   not exist - is it a part of some ideology or a
> partial solution?
> >
> >   So what is the best way to use commons-logging -
> use one logger
> >   instance from base class (so make log in
> ActionServlet protected and
> >   add get method for it) or retrieve logger
> instance for every class
> >   (so for extended version of the ActionServlet it
> would be another
> >   logger for another classname)?
> >
> 
> Although I agree with you that the ActionServlet's
> notion of a Log
> instance should be available somehow (probably
> through a public getter
> method), my current preference has been to have a
> separate named Log
> instance per Struts sub-application.  That means
> that sub-apps (and, by
> extension of the same philosophy, add-on components)
> should define their
> own logger names.
> 
> One non-obvious facet of the SimpleLog
> implementation in commons-logging
> 1.0 (and, I *think*, in Log4J and JDK 1.4 logging as
> well) is that logging
> level setting is hierarchical -- if a level is not
> set for a particular
> logger name, then SimpleLog will start chopping off
> "." delimited
> components before it uses the default level. 
> Therefore, you can configure
> a logging level for "org.apache.struts" that applies
> to *all* loggers
> whose names start with this, unless they are
> explicity set to some other
> value.
> 
> >
> > --
> > Best regards,
> >  Oleg                         
> mailto:[EMAIL PROTECTED]
> >
> 
> Craig
> 
> 
> --
> To unsubscribe, e-mail:  
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 


__________________________________________________
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/

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

Reply via email to