tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: [5] commons-logging
Date Tue, 06 Aug 2002 21:01:32 GMT


On Tue, 6 Aug 2002 costinm@covalent.net wrote:

> Date: Tue, 6 Aug 2002 13:50:22 -0700 (PDT)
> From: costinm@covalent.net
> Reply-To: Tomcat Developers List <tomcat-dev@jakarta.apache.org>
> To: Tomcat Developers List <tomcat-dev@jakarta.apache.org>
> Subject: Re: [5] commons-logging
>
> I attached my version :-) I converted several classes ( those I suspect of
> taking the most time and where I get exceptions and I need the nested
> stack trace to debug ).
>
> I think:
>  - debug field should be deprecated.
>     if( log.isDebugEnabled() ) log.debug();,
>  - convert debug>=1 to log.debug(),
> 	   debug>=2 to log.trace().
>

+1

>  - use the 'usual' conventions for name -
>     LogFactory.getLog( ApplicationDispatcher.class );
>

This is certainly simpler on the Tomcat developers.  A related convention
would be to *not* make the Log instance static (as I've done in other
scewnarios where I really did want to share the same Log instance across
multiple application object instances), right?

> Don't worry about host/context names - that'll be addressed separately.
> We don't know yet very well how :-), but most likely we'll need some
> changes to commons-logging factory to allow us to intercept the
> log creation and insert the 'context' info ( associated with the context
> class loader ).
>

LogFactory can do some interesting magic -- it ought to be possible to do
something useful.  However, counting on the context class loader is going
to be problematic in the parts of Catalina "above" contexts (such as the
code that maps a request URL to a particular webapp).  I'd bet we aren't
very careful, right now, about maintaining the thread context class loader
in those situations.

> Ceki posted some info about how this will work with log4j - we'll
> have to do that for all loggers.
>
> I expect 'host/contextPath' to either be inserted in the log name
> or somehow associated with the context classloader to locate a
> local config.
>
> Costin
>

Craig

>
> On 6 Aug 2002, Bob Herrmann wrote:
>
> >
> > "Just for fun", I updated ApplicationDispatcher.java to use
> > commons-logging.  It may not be representative in some ways (it defines
> > its own debug level), but it was interesting to see what the changes
> > look like.
> >
> > Does it look like I changed it correctly?  (especially the way I chose
> > to initialize a private field "Log" in the constructor.)
> >
>


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


Mime
View raw message