avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <dona...@apache.org>
Subject Re: LogKit question!
Date Sat, 30 Jun 2001 08:04:58 GMT
On Sat, 30 Jun 2001 13:33, Mircea Toma wrote:
> I want to use LogKit to do logging in a J2EE application and in order to
> access consistently my components I want to mount the Logger in the JNDI
> tree. I have an object that implements javax.naming.Referenceable that
> contains the information about how to configure the Logger and a
> javax.naming.spi.ObjectFactory that will create the Logger/-s when a lookup
> is done. My question is: should I create a new Logger each time in the
> ObjectFactory or should I pass the same Logger instance?

Well I guess it depends ;) The way I like to set it up is that for every 
separate "application" I have a separate Hierarchy object. And then for each 
relevent subsytem in application I create a new Logger.

This way I can easily manage all the logging for one application easily. It 
also means that if I am debuging a certain subsystem (say the persistence 
subsystem) then I can turn up the debugging so all messages are passed 
through for that subsystem but not others. 

So each subsystem is a different category and each application is a different 
Hierarchy is my recomendation ;) Note that this will not always work if you 
are using a distributed application.

Cheers,

Pete

*-----------------------------------------------------*
| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof."                   |
|              - John Kenneth Galbraith               |
*-----------------------------------------------------*

---------------------------------------------------------------------
To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: avalon-dev-help@jakarta.apache.org


Mime
View raw message