logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Regele, Manfred" <Manfred.Reg...@Adig.de>
Subject AW: Sample usage of NDC in servlets.
Date Thu, 03 Jan 2002 10:27:10 GMT
Uargh,

Now you GOT me aware ! 

I have added the missing remove()-calls - and will
upgrade to a new log4j release as soon as possible to use the mdc.

Luckily I wrapped all log4j calls in my own Log.class - sometimes this pays
of
in spite of the performance penalty.

Thanks for your advice.

Manfred Regele 
Dipl. Betriebswirt (BA)
ADIG Investment GmbH
22 Methoden&Tools
Richard-Reitzner-Allee 2
85540 Haar
Tel: 089/46268-308
mailto:Manfred.Regele@Adig.de
http://www.adig.de

> -----Urspr√ľngliche Nachricht-----
> Von:	Mark Womack [SMTP:mwomack@bevocal.com]
> Gesendet am:	Mittwoch, 2. Januar 2002 17:44
> An:	'Log4J Users List'
> Betreff:	RE: Sample usage of NDC in servlets.
> 
> Pushing the session id is a pretty good use of the NDC in servlets, and
> this
> is a good example code.  But be aware that you will need to call the
> NDC.remove() method periodically, otherwise you will end up with a huge
> memory leak over time.  Do not ignore the notes in the api documentation.
> It has my experience that a new NDC reference was created for EACH request
> object, which is stored statically in the NDC.  This caused the request
> object to not be released at the end of the request, and any attributes it
> happened to reference were not released as well.  It doesn't take much to
> see this is a problem.
> 
> Using the new MDC class might be a better way to go.  Or updating the NDC
> code to use the same mechanism as the MDC class to free memory when a
> thread
> is no longer being used.
> 
> just be aware,
> -Mark
> 
> 

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


Mime
View raw message