or you can write a servlet filter to remove it at the end. it will clean up MDC 
for all the requests. you can do something like this in the filter:

    public void doFilter (ServletRequest request, ServletResponse response,
                         FilterChain chain) throws IOException, 
ServletException {
        try {
            chain.doFilter(request, response);
        } finally {
            MDC.remove();
        }
    }

just make sure this filter is the first one in the chain, or no other filters 
before this one sets any MDC object. 

> On Sun, 20 Feb 2005 08:28:56 +0200 (EET), Juha Laiho 
> <[EMAIL PROTECTED]>  wrote:
> 
> > On Sat, 19 Feb 2005, [iso-8859-15] Ana Paula BrandÃo Lopes wrote:
> >> I was reading the log4j api where is said the programmer has to call
> >> NDC.remove() at the end of the run() method of the threads
> > [...]
> >> In web apps, the run methods is not at the programmers hands, the  servlet
> >> container is the responsible for this.
> >> How to solve this?

-- 
___________________________________________________________
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm


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

Reply via email to