In truth i thought to store those infos in our Logger class when we create it.
Then our software would just call debug,info,warn,error and fatal and the 
Logger would attach these infos to and send a String to log4j with optional 
object and/or exception...
Am i right in this way?
I tried to understand MDC but i lack in something may be... 

-----Messaggio originale-----
Da: James Stauffer [mailto:[EMAIL PROTECTED] 
Inviato: giovedì 23 giugno 2005 16.36
A: Log4J Users List
Oggetto: Re: Creating our own logger

I had a similiar situation and I made our internal Logger class just pass the 
event to log4j.  You can store userAddress and userName in MDC.  Then weather 
the code uses the internal logger or log4j directly it still ends up in the 
same place.  The only thing is that code using the internal logger obviously 
didn't produce logs that were as good (they all went to the same logger path, 
were all either error or info,
etc) because log4j was much better than our internal logger.

On 6/23/05, Fabrizio Squittieri <[EMAIL PROTECTED]> wrote:
> Hi there,
> we have an old logger, an "homemade" one and now we want to switch our 
> logging to log4j.
> We have to cope with the old one for the future as all the model 
> software written until now can't be rewritten to suite the old log.
> Moreover we want a more powerful Logger class, as we must hold infos 
> as userAddress userName and so on.
> 
> In this scenario i thought to extend log4j and create my own Logger 
> class, in this way i can use all the log4j features and specialize 
> behaviour as we want.
> I would like to have a common interface as i can see this new Logger 
> by this interface in my new model software where it arrives after been 
> created by a servlet (which will be responsible of setting extra 
> infos) whilst for the old software can be seen as the old logger.
> 
> So it would be
> 
> Logging interface (which?)     Old logger
>                             ^              ^
>                             |               |
>                         My new Logger
> 
> But the point is that i can't see any interface implemented by log4j 
> as i hoped...
> In fact i tuought it would have been a Logging interface implemented 
> by log4j and java.util.working...
> That's not truth unfortunately.
> 
> What do you suggest?
> Thanks
> 
> 
> Fabrizio Squittieri - Programmatore
> 
> Sistema informativo - Comune di Prato
> Via Cairoli 16 - Prato
> 0574615275
> 
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> 
> 
> 
> 
> 


--
James Stauffer
Are you good? Take the test at http://www.livingwaters.com/good/

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


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

Reply via email to