yoavs       2003/06/06 18:43:55

  Modified:    src/java/org/apache/log4j/servlet CookieMDCFilter.java
  Log:
  - Added comment regarding when to initiailize logger
  - Added clearing of map in destroy() method
  
  Revision  Changes    Path
  1.4       +13 -3     
jakarta-log4j-sandbox/src/java/org/apache/log4j/servlet/CookieMDCFilter.java
  
  Index: CookieMDCFilter.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-log4j-sandbox/src/java/org/apache/log4j/servlet/CookieMDCFilter.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- CookieMDCFilter.java      28 Feb 2003 05:10:12 -0000      1.3
  +++ CookieMDCFilter.java      7 Jun 2003 01:43:55 -0000       1.4
  @@ -75,6 +75,7 @@
     the MDC is the value of the cookie in the request.
   
     @author Mark Womack <[EMAIL PROTECTED]>
  +  @author Yoav Shapira <[EMAIL PROTECTED]>
     @since 1.3
     */
   
  @@ -111,7 +112,11 @@
   //    </appender>
   public class CookieMDCFilter implements Filter {
     /**
  -    private trace logger. */
  +    private trace logger.
  +    YS 2003-06-06: do we want to wait for 1st request
  +      to initialize logger?  Log4j may not be configured
  +      until after filter initialization.  
  +   */
     private static final Logger LOG = Logger.getLogger(CookieMDCFilter.class);
   
     /**
  @@ -197,8 +202,13 @@
     }
   
     /**
  -    Not used. */
  +    * Clears the map.
  +    */
     public void destroy() {
  -    // do nothing
  +    if(cookieMap != null) {
  +      cookieMap.clear();
  +    }
  +
  +    cookieMap = null;
     }
   }
  
  
  

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

Reply via email to