You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by ce...@apache.org on 2005/02/18 18:23:45 UTC

cvs commit: logging-log4j/src/java/org/apache/log4j/joran/action ParamAction.java

ceki        2005/02/18 09:23:45

  Modified:    tests/src/java/org/apache/log4j/html Loop.java
               tests/src/java/org/apache/log4j/rolling
                        FilterBasedRollingTest.java RenamingTest.java
                        TimeBasedRollingTest.java SizeBasedRollingTest.java
               src/java/org/apache/log4j/varia ListModelAppender.java
                        NullAppender.java
               tests/src/java/org/apache/log4j/multiplex
                        MultiplexAppenderTest.java
               tests/src/java/org/apache/log4j/performance Loop.java
                        NullAppender.java
               src/java/org/apache/log4j/multiplex MultiplexAppender.java
                        AppenderFactoryUtils.java
               src/java/org/apache/log4j/watchdog FileWatchdog.java
                        WatchdogSkeleton.java TimedURLWatchdog.java
               src/java/org/apache/log4j/net MulticastAppender.java
                        JMSAppender.java SMTPAppender.java
                        SyslogAppender.java TelnetAppender.java
                        SocketAppender.java UDPAppender.java
               src/java/org/apache/log4j/rolling RollingFileAppender.java
               src/java/org/apache/log4j WriterAppender.java
                        AsyncAppender.java ConsoleAppender.java
                        Appender.java FileAppender.java
                        AppenderSkeleton.java LogManager.java
               tests/src/java/org/apache/log4j VectorAppender.java
                        AsyncAppenderTestCase.java
               src/java/org/apache/log4j/config ConfiguratorBase.java
               src/java/org/apache/log4j/db DBAppender.java
               src/java/org/apache/log4j/spi ComponentBase.java
               tests/witness/xml dom.A1.2 dom.A2.1 dom.A2.2 dom.A1.1
               src/java/org/apache/log4j/joran JoranConfigurator.java
               tests/src/java/org/apache/log4j/helpers
                        OptionSubstitutionTest.java
               tests/src/java/org/apache/log4j/watchdog
                        FileWatchdogTestCase.java
               src/java/org/apache/log4j/chainsaw
                        ChainsawAppenderHandler.java ChainsawAppender.java
               tests    build.xml
               src/java/org/apache/log4j/helpers OptionConverter.java
               src/java/org/apache/log4j/joran/action ParamAction.java
  Added:       tests/input/xml DOMTest2.xml DOMTest1.xml
               tests/src/java/org/apache/log4j LoggerTest.java
               tests/src/java/org/apache/log4j/xml DOMTest.java
  Removed:     tests/input/xml DOMTestCase1.xml DOMTestCase2.xml
               tests/src/java/org/apache/log4j LoggerTestCase.java
               tests/src/java/org/apache/log4j/xml DOMTestCase.java
  Log:
  - Added the isClosed(), activate(), isActive() methods to the Appender interface.
  
  Ther idea is to avoid using appenders which are not in working order. Moreover, in future version, we would like to introduce
  the capability for appenders suffering from temporary error conditions to have a recovery lifecycle.
  
  - Added getNonFloodingLogger method to ComponentBase. This method returns a NOPLogger if called too frequently.
  
  - Other minor changes.
  
  Revision  Changes    Path
  1.4       +1 -1      logging-log4j/tests/src/java/org/apache/log4j/html/Loop.java
  
  Index: Loop.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/tests/src/java/org/apache/log4j/html/Loop.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Loop.java	4 Nov 2004 15:44:56 -0000	1.3
  +++ Loop.java	18 Feb 2005 17:23:43 -0000	1.4
  @@ -38,7 +38,7 @@
       appender.setFile("toto.html");
       appender.setAppend(false);
       appender.setLayout(htmlLayout);
  -    appender.activateOptions();
  +    appender.activate();
       Logger root = Logger.getRootLogger();
       root.addAppender(appender);
   
  
  
  
  1.2       +2 -5      logging-log4j/tests/src/java/org/apache/log4j/rolling/FilterBasedRollingTest.java
  
  Index: FilterBasedRollingTest.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/tests/src/java/org/apache/log4j/rolling/FilterBasedRollingTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FilterBasedRollingTest.java	12 Feb 2005 18:42:12 -0000	1.1
  +++ FilterBasedRollingTest.java	18 Feb 2005 17:23:43 -0000	1.2
  @@ -16,12 +16,9 @@
   
   package org.apache.log4j.rolling;
   
  -import junit.framework.Test;
   import junit.framework.TestCase;
  -import junit.framework.TestSuite;
   
  -import org.apache.log4j.Appender;
  -import org.apache.log4j.ConsoleAppender;
  +
   import org.apache.log4j.Level;
   import org.apache.log4j.LogManager;
   import org.apache.log4j.Logger;
  @@ -89,7 +86,7 @@
   
       rfa.setRollingPolicy(swrp);
       rfa.setTriggeringPolicy(fbtp);
  -    rfa.activateOptions();
  +    rfa.activate();
       Logger.getRootLogger().addAppender(rfa);
   
       common("output/filterBased-test2");
  
  
  
  1.2       +1 -1      logging-log4j/tests/src/java/org/apache/log4j/rolling/RenamingTest.java
  
  Index: RenamingTest.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/tests/src/java/org/apache/log4j/rolling/RenamingTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RenamingTest.java	31 May 2004 21:14:24 -0000	1.1
  +++ RenamingTest.java	18 Feb 2005 17:23:43 -0000	1.2
  @@ -72,7 +72,7 @@
       tbrp.setActiveFileName("output/test.log");
       tbrp.activateOptions();
       rfa.setRollingPolicy(tbrp);
  -    rfa.activateOptions();
  +    rfa.activate();
   
       Calendar cal = Calendar.getInstance();
   
  
  
  
  1.16      +8 -8      logging-log4j/tests/src/java/org/apache/log4j/rolling/TimeBasedRollingTest.java
  
  Index: TimeBasedRollingTest.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/tests/src/java/org/apache/log4j/rolling/TimeBasedRollingTest.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- TimeBasedRollingTest.java	4 Jan 2005 19:42:11 -0000	1.15
  +++ TimeBasedRollingTest.java	18 Feb 2005 17:23:43 -0000	1.16
  @@ -84,7 +84,7 @@
       tbrp.setFileNamePattern("output/test1-%d{" + datePattern + "}");
       tbrp.activateOptions();
       rfa.setRollingPolicy(tbrp);
  -    rfa.activateOptions();
  +    rfa.activate();
       logger.addAppender(rfa);
   
       SimpleDateFormat sdf = new SimpleDateFormat(datePattern);
  @@ -129,7 +129,7 @@
       tbrp1.setFileNamePattern("output/test2-%d{" + datePattern + "}");
       tbrp1.activateOptions();
       rfa1.setRollingPolicy(tbrp1);
  -    rfa1.activateOptions();
  +    rfa1.activate();
       logger.addAppender(rfa1);
   
       SimpleDateFormat sdf = new SimpleDateFormat(datePattern);
  @@ -162,7 +162,7 @@
       tbrp2.setFileNamePattern("output/test2-%d{" + datePattern + "}");
       tbrp2.activateOptions();
       rfa2.setRollingPolicy(tbrp2);
  -    rfa2.activateOptions();
  +    rfa2.activate();
       logger.addAppender(rfa2);
   
       for (int i = 3; i <= 4; i++) {
  @@ -189,7 +189,7 @@
       tbrp.setFileNamePattern("output/test3-%d{" + datePattern + "}.gz");
       tbrp.activateOptions();
       rfa.setRollingPolicy(tbrp);
  -    rfa.activateOptions();
  +    rfa.activate();
       logger.addAppender(rfa);
   
       SimpleDateFormat sdf = new SimpleDateFormat(datePattern);
  @@ -239,7 +239,7 @@
       tbrp1.setFileNamePattern("output/test4-%d{" + datePattern + "}");
       tbrp1.activateOptions();
       rfa1.setRollingPolicy(tbrp1);
  -    rfa1.activateOptions();
  +    rfa1.activate();
       logger.addAppender(rfa1);
   
       SimpleDateFormat sdf = new SimpleDateFormat(datePattern);
  @@ -274,7 +274,7 @@
       tbrp2.setActiveFileName("output/test4.log");
       tbrp2.activateOptions();
       rfa2.setRollingPolicy(tbrp2);
  -    rfa2.activateOptions();
  +    rfa2.activate();
       logger.addAppender(rfa2);
   
       for (int i = 3; i <= 4; i++) {
  @@ -302,7 +302,7 @@
       tbrp.setActiveFileName("output/test5.log");
       tbrp.activateOptions();
       rfa.setRollingPolicy(tbrp);
  -    rfa.activateOptions();
  +    rfa.activate();
       logger.addAppender(rfa);
   
       SimpleDateFormat sdf = new SimpleDateFormat(datePattern);
  @@ -346,7 +346,7 @@
       tbrp.setActiveFileName("output/test6.log");
       tbrp.activateOptions();
       rfa.setRollingPolicy(tbrp);
  -    rfa.activateOptions();
  +    rfa.activate();
       logger.addAppender(rfa);
   
       SimpleDateFormat sdf = new SimpleDateFormat(datePattern);
  
  
  
  1.9       +2 -2      logging-log4j/tests/src/java/org/apache/log4j/rolling/SizeBasedRollingTest.java
  
  Index: SizeBasedRollingTest.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/tests/src/java/org/apache/log4j/rolling/SizeBasedRollingTest.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- SizeBasedRollingTest.java	9 Dec 2004 13:27:21 -0000	1.8
  +++ SizeBasedRollingTest.java	18 Feb 2005 17:23:43 -0000	1.9
  @@ -98,7 +98,7 @@
       
       rfa.setRollingPolicy(swrp);
       rfa.setTriggeringPolicy(sbtp);
  -    rfa.activateOptions();
  +    rfa.activate();
       root.addAppender(rfa);
   
       // Write exactly 10 bytes with each log
  @@ -142,7 +142,7 @@
        fwrp.activateOptions();
        rfa.setRollingPolicy(fwrp);
        rfa.setTriggeringPolicy(sbtp);
  -     rfa.activateOptions();
  +     rfa.activate();
        root.addAppender(rfa);
   
        // Write exactly 10 bytes with each log
  
  
  
  1.3       +0 -7      logging-log4j/src/java/org/apache/log4j/varia/ListModelAppender.java
  
  Index: ListModelAppender.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/varia/ListModelAppender.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ListModelAppender.java	22 Nov 2004 20:20:59 -0000	1.2
  +++ ListModelAppender.java	18 Feb 2005 17:23:43 -0000	1.3
  @@ -57,13 +57,6 @@
       clearModel();
     }
   
  -  /* (non-Javadoc)
  -   * @see org.apache.log4j.Appender#requiresLayout()
  -   */
  -  public boolean requiresLayout() {
  -    return false;
  -  }
  -
     /**
      * Removes all the Events from the model
      */
  
  
  
  1.5       +0 -6      logging-log4j/src/java/org/apache/log4j/varia/NullAppender.java
  
  Index: NullAppender.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/varia/NullAppender.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- NullAppender.java	11 Sep 2003 08:47:52 -0000	1.4
  +++ NullAppender.java	18 Feb 2005 17:23:43 -0000	1.5
  @@ -52,10 +52,4 @@
     protected void append(LoggingEvent event) {
     }
   
  -  /**
  -    * NullAppenders do not need a layout.  
  -    * */
  -  public boolean requiresLayout() {
  -    return false;
  -  }
   }
  
  
  
  1.1                  logging-log4j/tests/input/xml/DOMTest2.xml
  
  Index: DOMTest2.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8" ?>
  <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
  
  <log4j:configuration xmlns:log4j='http://logging.apache.org/'>
    <appender name="A1" class="org.apache.log4j.FileAppender">
      
      <param name="File"   value="output\temp.A1.2" />
      <param name="Append" value="false" />	    
      
      <layout class="org.apache.log4j.PatternLayout">
        <param name="ConversionPattern" value="%-5p %c{2} - %m%n"/>
      </layout>	    
    </appender>
    
    <appender name="A2" class="org.apache.log4j.FileAppender">
      <param name="File" value="output\temp.A2.2" />
      <param name="Append" value="false" />
      <layout class="org.apache.log4j.TTCCLayout">
        <param name="DateFormat" value="ISO8601" />
      </layout>		
    </appender>
  
    <!-- Prevent internal log4j DEBUG messages from polluting the output. -->
    <logger name="org.apache.log4j.joran"><level value="INFO" /></logger>
    <logger name="org.apache.log4j.joran.action.PriorityAction"><level value="ERROR" /></logger>
    <logger name="org.apache.log4j.config"><level value="INFO" /></logger>
    <logger name="org.apache.log4j.FileAppender"><level value="INFO" /></logger>
    
    <logger name="org.apache.log4j.xml">
      <level value="debug" />
      <appender-ref ref="A1" />
    </logger>
    
    <root>
      <priority value ="debug" />
      <appender-ref ref="A1" />
      <appender-ref ref="A2" />
    </root>
    
  </log4j:configuration>
  
  
  
  1.1                  logging-log4j/tests/input/xml/DOMTest1.xml
  
  Index: DOMTest1.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8" ?>
  <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
  
  <log4j:configuration xmlns:log4j='http://logging.apache.org/'>
    <appender name="A1" class="org.apache.log4j.FileAppender">
      
      <param name="File"   value="output/temp.A1" />
      <param name="Append" value="false" />	    
      
      <layout class="org.apache.log4j.PatternLayout">
        <param name="ConversionPattern" value="%-5p %c{2} - %m%n"/>
      </layout>	    
    </appender>
    
    <appender name="A2" class="org.apache.log4j.FileAppender">
      <param name="File" value="output/temp.A2" />
      <param name="Append" value="false" />
      <layout class="org.apache.log4j.TTCCLayout">
        <param name="DateFormat" value="ISO8601" />
      </layout>		
    </appender>
  
    <!-- Prevent internal log4j DEBUG messages from polluting the output. -->
    <logger name="org.apache.log4j.joran"><level value="INFO" /></logger>
    <logger name="org.apache.log4j.joran.action.PriorityAction"><level value="ERROR" /></logger>
    <logger name="org.apache.log4j.config"><level value="INFO" /></logger>
    <logger name="org.apache.log4j.FileAppender"><level value="INFO" /></logger>
    
    <logger name="org.apache.log4j.xml">
      <level value="debug" />
      <appender-ref ref="A1" />
    </logger>
    
    <root>
      <priority value ="debug" />
      <appender-ref ref="A1" />
      <appender-ref ref="A2" />
    </root>
    
  </log4j:configuration>
  
  
  
  1.2       +1 -1      logging-log4j/tests/src/java/org/apache/log4j/multiplex/MultiplexAppenderTest.java
  
  Index: MultiplexAppenderTest.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/tests/src/java/org/apache/log4j/multiplex/MultiplexAppenderTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MultiplexAppenderTest.java	17 Oct 2004 23:24:13 -0000	1.1
  +++ MultiplexAppenderTest.java	18 Feb 2005 17:23:43 -0000	1.2
  @@ -37,7 +37,7 @@
   
   		appender = new MultiplexAppender();
   		try {
  -			appender.activateOptions();
  +			appender.activate();
   			fail("Should have thrown an IllegalStateException because it should not be configured correctly");
   		} catch (Exception e) {
   			// expected
  
  
  
  1.6       +1 -1      logging-log4j/tests/src/java/org/apache/log4j/performance/Loop.java
  
  Index: Loop.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/tests/src/java/org/apache/log4j/performance/Loop.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Loop.java	30 Sep 2004 08:59:50 -0000	1.5
  +++ Loop.java	18 Feb 2005 17:23:43 -0000	1.6
  @@ -40,7 +40,7 @@
       ConsoleAppender a = new ConsoleAppender();
       a.setLayout(new PatternLayout("%d %level %c - %m%n"));
       a.setName("console");
  -    a.activateOptions();
  +    a.activate();
       j.addAppender(a);
   
       if (args.length == 2) {
  
  
  
  1.2       +23 -25    logging-log4j/tests/src/java/org/apache/log4j/performance/NullAppender.java
  
  Index: NullAppender.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/tests/src/java/org/apache/log4j/performance/NullAppender.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- NullAppender.java	6 Sep 2004 14:47:24 -0000	1.1
  +++ NullAppender.java	18 Feb 2005 17:23:43 -0000	1.2
  @@ -1,15 +1,25 @@
   /*
  - * Copyright (C) The Apache Software Foundation. All rights reserved.
  + * Copyright 1999,2005 The Apache Software Foundation.
    *
  - * This software is published under the terms of the Apache Software
  - * License version 1.1, a copy of which has been included with this
  - * distribution in the LICENSE.txt file.  */
  + * Licensed under the Apache License, Version 2.0 (the "License");
  + * you may not use this file except in compliance with the License.
  + * You may obtain a copy of the License at
  + *
  + *      http://www.apache.org/licenses/LICENSE-2.0
  + *
  + * Unless required by applicable law or agreed to in writing, software
  + * distributed under the License is distributed on an "AS IS" BASIS,
  + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  + * See the License for the specific language governing permissions and
  + * limitations under the License.
  + */
   
   package org.apache.log4j.performance;
   
  +import org.apache.log4j.AppenderSkeleton;
   import org.apache.log4j.Layout;
   import org.apache.log4j.spi.LoggingEvent;
  -import org.apache.log4j.AppenderSkeleton;
  +
   
   /**
    * A bogus appender which calls the format method of its layout object
  @@ -21,38 +31,26 @@
    * included in the <em>log4j.jar</em> file.</b> </p>
    * */
   public class NullAppender extends AppenderSkeleton {
  -
     public static String s;
     public String t;
   
  -  public
  -  NullAppender() {}
  +  public NullAppender() {
  +  }
   
  -  public
  -  NullAppender(Layout layout) {
  +  public NullAppender(Layout layout) {
       this.layout = layout;
     }
   
  -  public
  -  void close() {}
  +  public void close() {
  +  }
   
  -  public
  -  void doAppend(LoggingEvent event) {
  -    if(layout != null) {
  +  public void doAppend(LoggingEvent event) {
  +    if (layout != null) {
         t = layout.format(event);
         s = t;
       }
     }
   
  -  public
  -  void append(LoggingEvent event) {
  -  }
  -
  -  /**
  -     This is a bogus appender but it still uses a layout.
  -  */
  -  public
  -  boolean requiresLayout() {
  -    return true;
  +  public void append(LoggingEvent event) {
     }
   }
  
  
  
  1.2       +2 -4      logging-log4j/src/java/org/apache/log4j/multiplex/MultiplexAppender.java
  
  Index: MultiplexAppender.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/multiplex/MultiplexAppender.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MultiplexAppender.java	17 Oct 2004 23:24:13 -0000	1.1
  +++ MultiplexAppender.java	18 Feb 2005 17:23:44 -0000	1.2
  @@ -21,7 +21,7 @@
   	 * 
   	 * @see org.apache.log4j.spi.OptionHandler#activateOptions()
   	 */
  -	public void activateOptions() {
  +	public void activate() {
   
   
   		// check that we have a selector of something at this point
  @@ -30,9 +30,7 @@
   					"Should have had a Selector defined at this point");
   		}
   
  -        // TODO work out how the Selector has it's AppenderFactory configured by Joran
  -      
  -
  +    // TODO work out how the Selector has it's AppenderFactory configured by Joran
   	}
   
   	/*
  
  
  
  1.3       +2 -2      logging-log4j/src/java/org/apache/log4j/multiplex/AppenderFactoryUtils.java
  
  Index: AppenderFactoryUtils.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/multiplex/AppenderFactoryUtils.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AppenderFactoryUtils.java	2 Nov 2004 14:40:53 -0000	1.2
  +++ AppenderFactoryUtils.java	18 Feb 2005 17:23:44 -0000	1.3
  @@ -38,7 +38,7 @@
   				tbrp.activateOptions();
   				RollingFileAppender rfa = new RollingFileAppender();
   				rfa.setRollingPolicy(tbrp);
  -				rfa.activateOptions();
  +				rfa.activate();
   				return rfa;
   
   			}
  @@ -67,7 +67,7 @@
   					FileAppender fileAppender = new FileAppender(layout,
   							MessageFormat.format(pattern,
   									new Object[] { value }));
  -					fileAppender.activateOptions();
  +					fileAppender.activate();
   					return fileAppender;
   				} catch (Exception ex) {
   					//throw new RuntimeException(ex);
  
  
  
  1.2       +0 -1      logging-log4j/src/java/org/apache/log4j/watchdog/FileWatchdog.java
  
  Index: FileWatchdog.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/watchdog/FileWatchdog.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FileWatchdog.java	30 Jan 2005 06:40:01 -0000	1.1
  +++ FileWatchdog.java	18 Feb 2005 17:23:44 -0000	1.2
  @@ -17,7 +17,6 @@
   package org.apache.log4j.watchdog;
   
   import java.io.File;
  -import java.net.URL;
   
   /**
    * Implements a watchdog to watch a file.  When the file changes, determined by
  
  
  
  1.2       +1 -3      logging-log4j/src/java/org/apache/log4j/watchdog/WatchdogSkeleton.java
  
  Index: WatchdogSkeleton.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/watchdog/WatchdogSkeleton.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- WatchdogSkeleton.java	30 Jan 2005 06:40:01 -0000	1.1
  +++ WatchdogSkeleton.java	18 Feb 2005 17:23:44 -0000	1.2
  @@ -16,11 +16,9 @@
   
   package org.apache.log4j.watchdog;
   
  -import org.apache.log4j.Logger;
  -import org.apache.log4j.LogManager;
  +
   import org.apache.log4j.PropertyConfigurator;
   import org.apache.log4j.spi.Configurator;
  -import org.apache.log4j.plugins.Plugin;
   import org.apache.log4j.plugins.PluginSkeleton;
   import org.apache.log4j.helpers.OptionConverter;
   
  
  
  
  1.2       +0 -2      logging-log4j/src/java/org/apache/log4j/watchdog/TimedURLWatchdog.java
  
  Index: TimedURLWatchdog.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/watchdog/TimedURLWatchdog.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TimedURLWatchdog.java	30 Jan 2005 06:40:01 -0000	1.1
  +++ TimedURLWatchdog.java	18 Feb 2005 17:23:44 -0000	1.2
  @@ -18,9 +18,7 @@
   
   import java.net.URL;
   
  -import org.apache.log4j.LogManager;
   import org.apache.log4j.scheduler.Job;
  -import org.apache.log4j.scheduler.Scheduler;
   import org.apache.log4j.watchdog.WatchdogSkeleton;
   
   /**
  
  
  
  1.11      +1 -1      logging-log4j/src/java/org/apache/log4j/net/MulticastAppender.java
  
  Index: MulticastAppender.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/net/MulticastAppender.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- MulticastAppender.java	8 Feb 2005 14:31:35 -0000	1.10
  +++ MulticastAppender.java	18 Feb 2005 17:23:44 -0000	1.11
  @@ -76,7 +76,7 @@
     /**
        Open the multicast sender for the <b>RemoteHost</b> and <b>Port</b>.
     */
  -  public void activateOptions() {
  +  public void activate() {
       try {
         hostname = InetAddress.getLocalHost().getHostName();
       } catch (UnknownHostException uhe) {
  
  
  
  1.20      +1 -1      logging-log4j/src/java/org/apache/log4j/net/JMSAppender.java
  
  Index: JMSAppender.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/net/JMSAppender.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- JMSAppender.java	6 Jan 2005 17:03:11 -0000	1.19
  +++ JMSAppender.java	18 Feb 2005 17:23:44 -0000	1.20
  @@ -165,7 +165,7 @@
     /**
      *  Options are activated and become effective only after calling
      *  this method.*/
  -  public void activateOptions() {
  +  public void activate() {
       TopicConnectionFactory topicConnectionFactory;
   
       try {
  
  
  
  1.46      +1 -1      logging-log4j/src/java/org/apache/log4j/net/SMTPAppender.java
  
  Index: SMTPAppender.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/net/SMTPAppender.java,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- SMTPAppender.java	8 Jan 2005 14:05:28 -0000	1.45
  +++ SMTPAppender.java	18 Feb 2005 17:23:44 -0000	1.46
  @@ -106,7 +106,7 @@
     /**
        Activate the specified options, such as the smtp host, the
        recipient, from, etc. */
  -  public void activateOptions() {
  +  public void activate() {
       Properties props = new Properties(System.getProperties());
   
       if (smtpHost != null) {
  
  
  
  1.20      +1 -1      logging-log4j/src/java/org/apache/log4j/net/SyslogAppender.java
  
  Index: SyslogAppender.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/net/SyslogAppender.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- SyslogAppender.java	29 Nov 2004 15:36:46 -0000	1.19
  +++ SyslogAppender.java	18 Feb 2005 17:23:44 -0000	1.20
  @@ -156,7 +156,7 @@
     /**
      * This method returns immediately as options are activated when they are set.
      * */
  -  public void activateOptions() {
  +  public void activate() {
       if (facilityStr == null) {
         String errMsg =
           "The Facility option must be set for SyslogAppender named [" + name
  
  
  
  1.14      +1 -1      logging-log4j/src/java/org/apache/log4j/net/TelnetAppender.java
  
  Index: TelnetAppender.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/net/TelnetAppender.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- TelnetAppender.java	8 Jan 2005 14:05:28 -0000	1.13
  +++ TelnetAppender.java	18 Feb 2005 17:23:44 -0000	1.14
  @@ -67,7 +67,7 @@
   
     /** all of the options have been set, create the socket handler and
         wait for connections. */
  -  public void activateOptions() {
  +  public void activate() {
       try {
         sh = new SocketHandler(port);
         sh.start();
  
  
  
  1.27      +5 -3      logging-log4j/src/java/org/apache/log4j/net/SocketAppender.java
  
  Index: SocketAppender.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/net/SocketAppender.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- SocketAppender.java	6 Jan 2005 17:03:11 -0000	1.26
  +++ SocketAppender.java	18 Feb 2005 17:23:44 -0000	1.27
  @@ -132,7 +132,7 @@
       this.address = address;
       this.remoteHost = address.getHostName();
       this.port = port;
  -    connect(address, port);
  +    activate();
     }
   
     /**
  @@ -142,13 +142,13 @@
       this.port = port;
       this.address = getAddressByName(host);
       this.remoteHost = host;
  -    connect(address, port);
  +    activate();
     }
   
     /**
            Connect to the specified <b>RemoteHost</b> and <b>Port</b>.
     */
  -  public void activateOptions() {
  +  public void activate() {
       try {
         hostname = InetAddress.getLocalHost().getHostName();
       } catch (UnknownHostException uhe) {
  @@ -166,6 +166,8 @@
         getLogger().error(err);
         throw new IllegalStateException(err);
       }
  +    // all is dandy on the eastern front.
  +    super.activate();
     }
   
     /**
  
  
  
  1.12      +3 -3      logging-log4j/src/java/org/apache/log4j/net/UDPAppender.java
  
  Index: UDPAppender.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/net/UDPAppender.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- UDPAppender.java	8 Feb 2005 14:31:35 -0000	1.11
  +++ UDPAppender.java	18 Feb 2005 17:23:44 -0000	1.12
  @@ -82,7 +82,7 @@
       this.address = address;
       this.remoteHost = address.getHostName();
       this.port = port;
  -    connect(address, port);
  +    activate();
     }
   
     /**
  @@ -92,13 +92,13 @@
       this.port = port;
       this.address = getAddressByName(host);
       this.remoteHost = host;
  -    connect(address, port);
  +    activate();
     }
   
     /**
        Open the UDP sender for the <b>RemoteHost</b> and <b>Port</b>.
     */
  -  public void activateOptions() {
  +  public void activate() {
       try {
         hostname = InetAddress.getLocalHost().getHostName();
       } catch (UnknownHostException uhe) {
  
  
  
  1.23      +2 -2      logging-log4j/src/java/org/apache/log4j/rolling/RollingFileAppender.java
  
  Index: RollingFileAppender.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/rolling/RollingFileAppender.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- RollingFileAppender.java	12 Feb 2005 03:10:27 -0000	1.22
  +++ RollingFileAppender.java	18 Feb 2005 17:23:44 -0000	1.23
  @@ -81,7 +81,7 @@
       super();
     }
   
  -  public void activateOptions() {
  +  public void activate() {
       if (triggeringPolicy == null) {
         getLogger().warn("Please set a TriggeringPolicy for the RollingFileAppender named '{}'", getName());
         return;
  @@ -95,7 +95,7 @@
         
         // the activeFile variable is used by the triggeringPolicy.isTriggeringEvent method
         activeFile = new File(afn);
  -      super.activateOptions();
  +      super.activate();
       } else {
         getLogger().warn("Please set a rolling policy");
       }
  
  
  
  1.30      +20 -29    logging-log4j/src/java/org/apache/log4j/WriterAppender.java
  
  Index: WriterAppender.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/WriterAppender.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- WriterAppender.java	6 Jan 2005 17:03:11 -0000	1.29
  +++ WriterAppender.java	18 Feb 2005 17:23:44 -0000	1.30
  @@ -28,19 +28,15 @@
   //              Ben Sandee
   
   /**
  -   WriterAppender appends log events to a {@link java.io.Writer} or an
  -   {@link java.io.OutputStream} depending on the user's choice.
  -
  -   @author Ceki G&uuml;lc&uuml;
  -   @since 1.1 */
  + * WriterAppender appends log events to a {@link java.io.Writer} or an 
  + * {@link java.io.OutputStream} depending on the user's choice.
  + * 
  + * @author <a href="http://www.qos.ch/log4j/">Ceki G&uuml;lc&uuml;</a>
  + * @since 1.1 
  + * */
   public class WriterAppender extends AppenderSkeleton {
     
     /**
  -   * Set to true when the appender is in functioning order.
  -   */
  -  protected boolean inOrder = false;
  -  
  -  /**
        Immediate flush means that the underlying writer or output stream
        will be flushed at the end of each append operation. Immediate
        flush is slower but ensures that each append request is actually
  @@ -68,7 +64,8 @@
     protected Writer writer;
   
     /**
  -     This default constructor does nothing.  */
  +   * The default constructor does nothing.  
  +   * */
     public WriterAppender() {
     }
   
  @@ -96,6 +93,7 @@
     public WriterAppender(Layout layout, Writer writer) {
       this.layout = layout;
       this.setWriter(writer);
  +    this.activate();
     }
   
     /**
  @@ -124,16 +122,17 @@
     }
   
     /**
  -   * Does nothing.
  +   * Checks that requires parameters are set and if everything is in order, 
  +   * activates this appender.
     */
  -  public void activateOptions() {
  +  public void activate() {
       if (this.layout == null) {
         getLogger().error(
           "No layout set for the appender named [{}].", name);
       }
       
       if(this.writer != null) {
  -      inOrder = true;
  +      super.activate();
       }
     }
   
  @@ -173,13 +172,13 @@
        value <code>false</code> is returned. */
     protected boolean checkEntryConditions() {
       if (this.closed) {
  -      getLogger().warn("Not allowed to write to a closed appender.");
  +      getNonFloodingLogger().warn("Not allowed to write to a closed appender.");
   
         return false;
       }
   
       if (this.writer == null) {
  -      getLogger().error(
  +      getNonFloodingLogger().error(
           "No output stream or file set for the appender named [{}].", name);
   
         return false;
  @@ -286,7 +285,7 @@
      * @since 0.9.0 
      * */
     protected void subAppend(LoggingEvent event) {
  -    if(!this.inOrder) {
  +    if(!isActive()) {
         return;
       }
       
  @@ -310,20 +309,12 @@
           this.writer.flush();
         }
       } catch(IOException ioe) {
  -      this.inOrder = false;
  -      getLogger().error("IO failure for appender named "+name, ioe);
  +      this.active = false;
  +      getNonFloodingLogger().error("IO failure for appender named "+name, ioe);
       }
     }
   
     /**
  -     The WriterAppender requires a layout. Hence, this method returns
  -     <code>true</code>.
  -  */
  -  public boolean requiresLayout() {
  -    return true;
  -  }
  -
  -  /**
      * Clear internal references to the writer and other variables.
      * 
      * Subclasses can override this method for an alternate closing 
  @@ -348,7 +339,7 @@
             this.writer.write(f);
             this.writer.flush();
           } catch(IOException ioe) {
  -          inOrder = false;
  +          active = false;
             getLogger().error("Failed to write footer for Appender named "+name, ioe);
           }
         }
  @@ -367,7 +358,7 @@
           try {
             this.writer.write(h);
           } catch(IOException ioe) {
  -          this.inOrder = false;
  +          this.active = false;
             getLogger().error("Failed to write header for WriterAppender named "+name, ioe);
           }
         }
  
  
  
  1.44      +2 -1      logging-log4j/src/java/org/apache/log4j/AsyncAppender.java
  
  Index: AsyncAppender.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/AsyncAppender.java,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- AsyncAppender.java	13 Dec 2004 19:54:29 -0000	1.43
  +++ AsyncAppender.java	18 Feb 2005 17:23:44 -0000	1.44
  @@ -71,8 +71,9 @@
       aai = new AppenderAttachableImpl();
       dispatcher = new Dispatcher(bf, this);
       dispatcher.start();
  +    super.activate();
     }
  -
  +  
     public void addAppender(Appender newAppender) {
       synchronized (aai) {
         aai.addAppender(newAppender);
  
  
  
  1.22      +4 -4      logging-log4j/src/java/org/apache/log4j/ConsoleAppender.java
  
  Index: ConsoleAppender.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/ConsoleAppender.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- ConsoleAppender.java	8 Jan 2005 14:05:28 -0000	1.21
  +++ ConsoleAppender.java	18 Feb 2005 17:23:44 -0000	1.22
  @@ -22,7 +22,7 @@
     * <code>System.err</code> using a layout specified by the user. The
     * default target is <code>System.out</code>.
     *
  -  * @author Ceki G&uuml;lc&uuml;
  +  * @author <a href="http://www.qos.ch/log4j/">Ceki G&uuml;lc&uuml;</a>
     * @since 1.1 */
   public class ConsoleAppender extends WriterAppender {
     public static final String SYSTEM_OUT = "System.out";
  @@ -42,7 +42,7 @@
     public ConsoleAppender(Layout layout, String targetStr) {
       this.layout = layout;
       setTarget(targetStr);
  -    activateOptions();
  +    activate();
     }
   
     /**
  @@ -77,13 +77,13 @@
       getLogger().warn("Using previously set target, System.out by default.");
     }
   
  -  public void activateOptions() {
  +  public void activate() {
       if (target.equals(SYSTEM_OUT)) {
         setWriter(createWriter(System.out));
       } else {
         setWriter(createWriter(System.err));
       }
  -    super.activateOptions();
  +    super.activate();
     }
   
     /**
  
  
  
  1.17      +22 -0     logging-log4j/src/java/org/apache/log4j/Appender.java
  
  Index: Appender.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/Appender.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- Appender.java	6 Jan 2005 17:03:11 -0000	1.16
  +++ Appender.java	18 Feb 2005 17:23:44 -0000	1.17
  @@ -29,6 +29,12 @@
    * @author Ceki G&uuml;lc&uuml;
    */
   public interface Appender extends Component {
  +  
  +  /**
  +   * An appender must be activated before it can be used.
  +   */
  +  public void activate();
  +  
     /**
      * Add a filter to the end of the filter list.
      *
  @@ -65,6 +71,22 @@
      */
     public void close();
   
  +  
  +  /**
  +   * Is this appender closed?
  +   *
  +   * @since 1.3
  +   */
  +  public boolean isClosed();
  +
  +  /**
  +   * Is this appender in working order?
  +   *
  +   * @since 1.3
  +   */
  +  public boolean isActive();
  +  
  +  
     /**
      * Log in <code>Appender</code> specific way. When appropriate, Loggers will
      * call the <code>doAppend</code> method of appender implementations in
  
  
  
  1.50      +6 -45     logging-log4j/src/java/org/apache/log4j/FileAppender.java
  
  Index: FileAppender.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/FileAppender.java,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- FileAppender.java	11 Feb 2005 23:14:35 -0000	1.49
  +++ FileAppender.java	18 Feb 2005 17:23:44 -0000	1.50
  @@ -80,7 +80,7 @@
       int bufferSize) throws IOException {
       this.layout = layout;
       this.setFile(filename, append, bufferedIO, bufferSize);
  -    activateOptions();
  +    activate();
     }
   
     /**
  @@ -96,7 +96,7 @@
       throws IOException {
       this.layout = layout;
       this.setFile(filename, append, false, bufferSize);
  -    activateOptions();
  +    activate();
     }
   
     /**
  @@ -107,7 +107,7 @@
       <p>The file will be appended to.  */
     public FileAppender(Layout layout, String filename) throws IOException {
       this(layout, filename, true);
  -    activateOptions();
  +    activate();
     }
   
     /**
  @@ -123,7 +123,7 @@
       // Trim spaces from both ends. The users probably does not want
       // trailing spaces in file names.
       String val = file.trim();
  -    fileName = stripDuplicateBackslashes(val);
  +    fileName = OptionConverter.stripDuplicateBackslashes(val);
     }
   
     /**
  @@ -144,7 +144,7 @@
        <b>Append</b> properties.
   
        @since 0.8.1 */
  -  public void activateOptions() {
  +  public void activate() {
       if (fileName != null) {
         try {
           setFile(fileName, fileAppend, bufferedIO, bufferSize);
  @@ -157,7 +157,7 @@
         getLogger().warn("File option not set for appender [{}].", name);
         getLogger().warn("Are you using FileAppender instead of ConsoleAppender?");
       }
  -    super.activateOptions();
  +    super.activate();
     }
   
     /**
  @@ -271,43 +271,4 @@
       writeHeader();
       getLogger().debug("setFile ended");
     }
  -  
  -  /**
  -   * Replaces double backslashes (except the leading doubles in UNC's)
  -   * with single backslashes for compatibility with existing path specifications
  -   * that were working around use of OptionConverter.convertSpecialChars
  -   * in XML configuration files.
  -   * 
  -   * @param src source string
  -   * @return source string with double backslashes replaced
  -   * 
  -   * @since 1.3
  -   */
  -  public static String stripDuplicateBackslashes(final String src) {
  -  	int i = src.lastIndexOf('\\');
  -  	if (i > 0) {
  -  		StringBuffer buf = new StringBuffer(src);
  -  		for(; i > 0; i = src.lastIndexOf('\\', i - 1)) {
  -  			//
  -  			//  if the preceding character is a slash then
  -  			//     remove the preceding character
  -  			//     and continue processing with the earlier part of the string
  -  			if(src.charAt(i - 1) == '\\') {
  -  				buf.deleteCharAt(i);
  -  				i--;
  -  				if (i == 0) break;
  -  			} else {
  -  				//
  -  				//  if there was a single slash then
  -  				//    the string was not trying to work around
  -  				//    convertSpecialChars
  -  				//
  -  				return src;
  -  			}
  -  		}
  -  		return buf.toString();
  -  	}
  -  	return src;
  -  }
  -  
   }
  
  
  
  1.36      +39 -20    logging-log4j/src/java/org/apache/log4j/AppenderSkeleton.java
  
  Index: AppenderSkeleton.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/AppenderSkeleton.java,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- AppenderSkeleton.java	22 Jan 2005 18:18:33 -0000	1.35
  +++ AppenderSkeleton.java	18 Feb 2005 17:23:44 -0000	1.36
  @@ -70,16 +70,31 @@
     protected boolean closed = false;
   
     /**
  +   * By default, an appender is not in working order. It must be configured 
  +   * first. 
  +   */
  +  protected boolean active = false;
  +  
  +  /**
      * The guard prevents an appender from repeatedly calling its own doAppend
      * method.
      */
     private boolean guard = false;
     
     /**
  -   * Derived appenders should override this method if option structure
  -   * requires it.
  +   * Calls the {@link #activate} method.
  +   * 
  +   * @deprecated Please call the activate() method instead.
      */
     public void activateOptions() {
  +    activate();
  +  }
  +  
  +  /**
  +   * Default implementation called by sub-classes.
  +   */
  +  public void activate() {
  +    this.active = true;
     }
   
     /**
  @@ -209,13 +224,15 @@
       try {
         guard = true;
   
  -      if (closed) {
  -        // FIXME: We should not flood other appenders but at the same time
  -        // should output something meaningful (only once though).
  -        // Logging not allowed:
  -        //getLogger().error(
  -        //  "Attempted to append to closed appender named [{}].", name);
  +      if (this.closed) {
  +        getNonFloodingLogger().error(
  +            "Attempted to append to closed appender named [{}].", name);
  +        return;
  +      }
   
  +      if (!this.active) {
  +        getNonFloodingLogger().error(
  +            "Attempted to log with inactive appender named [{}].", name);
           return;
         }
   
  @@ -246,19 +263,21 @@
     }
   
     /**
  -   * Set the {@link ErrorHandler} for this Appender.
  -   *
  -   * @since 0.9.0
  +   * Returns true if this appender instance is closed.
  +   * @since 1.3
      */
  -//  public synchronized void setErrorHandler(ErrorHandler eh) {
  -//    if (eh == null) {
  -//      // We do not throw exception here since the cause is probably a
  -//      // bad config file.
  -//      getLogger().warn("You have tried to set a null error-handler.");
  -//    } else {
  -//      this.errorHandler = eh;
  -//    }
  -//  }
  +  public boolean isClosed() {
  +    return closed;
  +  }
  +
  +  /**
  +   * Returns true if this appender is working order.
  +   * @since 1.3
  +   */
  +  public boolean isActive() {
  +    // an appender can be active only if it is not closed
  +    return (active && !closed);
  +  }
   
     /**
      * Set the layout for this appender. Note that some appenders have their own
  
  
  
  1.41      +1 -0      logging-log4j/src/java/org/apache/log4j/LogManager.java
  
  Index: LogManager.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/LogManager.java,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- LogManager.java	20 Jan 2005 17:55:36 -0000	1.40
  +++ LogManager.java	18 Feb 2005 17:23:44 -0000	1.41
  @@ -59,6 +59,7 @@
      */
     public final static SimpleLoggerFA  SIMPLE_LOGGER_FA = new SimpleLoggerFA();
   
  +  
     // The following static initializer gets invoked immediately after a call to 
     // Logger.getLogger() is made. Here is a description of the static initializer.
     // 
  
  
  
  1.6       +5 -3      logging-log4j/tests/src/java/org/apache/log4j/VectorAppender.java
  
  Index: VectorAppender.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/tests/src/java/org/apache/log4j/VectorAppender.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- VectorAppender.java	24 May 2004 16:10:54 -0000	1.5
  +++ VectorAppender.java	18 Feb 2005 17:23:44 -0000	1.6
  @@ -30,12 +30,14 @@
     
     public VectorAppender() {
       vector = new Vector();
  +    super.activate();
     }
   
     /**
  -     Does nothing.
  -  */
  -  public void activateOptions() {
  +   * Defers to super.activate() method.
  +   */
  +  public void activate() {
  +    super.activate();
     }
   
     /**
  
  
  
  1.7       +1 -1      logging-log4j/tests/src/java/org/apache/log4j/AsyncAppenderTestCase.java
  
  Index: AsyncAppenderTestCase.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/tests/src/java/org/apache/log4j/AsyncAppenderTestCase.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- AsyncAppenderTestCase.java	20 Nov 2004 13:30:19 -0000	1.6
  +++ AsyncAppenderTestCase.java	18 Feb 2005 17:23:44 -0000	1.7
  @@ -42,7 +42,7 @@
       vectorAppender = new VectorAppender();
       vectorAppender.setDelay(DELAY);
       asyncAppender.addAppender(vectorAppender);
  -    asyncAppender.activateOptions();
  +    asyncAppender.activate();
       root.addAppender(asyncAppender);
     }
   
  
  
  
  1.1                  logging-log4j/tests/src/java/org/apache/log4j/LoggerTest.java
  
  Index: LoggerTest.java
  ===================================================================
  /*
   * Copyright 1999,2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  package org.apache.log4j;
  
  import junit.framework.Test;
  import junit.framework.TestCase;
  import junit.framework.TestSuite;
  
  import org.apache.log4j.spi.*;
  
  import java.util.Enumeration;
  import java.util.Locale;
  import java.util.ResourceBundle;
  
  
  /**
     Used for internal unit testing the Logger class.
  
     @author Ceki G&uuml;lc&uuml;
  
  */
  public class LoggerTest extends TestCase {
    // A short message.
    static String MSG = "M";
    Logger logger;
    Appender a1;
    Appender a2;
    ResourceBundle rbUS;
    ResourceBundle rbFR;
    ResourceBundle rbCH;
  
    public LoggerTest(String name) {
      super(name);
    }
  
    public void setUp() {
      rbUS = ResourceBundle.getBundle("L7D", new Locale("en", "US"));
      assertNotNull(rbUS);
  
      rbFR = ResourceBundle.getBundle("L7D", new Locale("fr", "FR"));
      assertNotNull("Got a null resource bundle.", rbFR);
  
      rbCH = ResourceBundle.getBundle("L7D", new Locale("fr", "CH"));
      assertNotNull("Got a null resource bundle.", rbCH);
    }
  
    public void tearDown() {
      // Regular users should not use the clear method lightly!
      //Logger.getDefaultHierarchy().clear();
      BasicConfigurator.resetConfiguration();
      a1 = null;
      a2 = null;
    }
  
    /**
       Add an appender and see if it can be retrieved.
    */
    public void testAppender1() {
      logger = Logger.getLogger("test");
      a1 = new FileAppender();
      a1.setName("testAppender1");
      logger.addAppender(a1);
  
      Enumeration enumeration = logger.getAllAppenders();
      Appender aHat = (Appender) enumeration.nextElement();
      assertEquals(a1, aHat);
    }
  
    /**
       Add an appender X, Y, remove X and check if Y is the only
       remaining appender.
    */
    public void testAppender2() {
      a1 = new FileAppender();
      a1.setName("testAppender2.1");
      a2 = new FileAppender();
      a2.setName("testAppender2.2");
  
      logger = Logger.getLogger("test");
      logger.addAppender(a1);
      logger.addAppender(a2);
      logger.removeAppender("testAppender2.1");
  
      Enumeration enumeration = logger.getAllAppenders();
      Appender aHat = (Appender) enumeration.nextElement();
      assertEquals(a2, aHat);
      assertTrue(!enumeration.hasMoreElements());
    }
  
    /**
       Test if logger a.b inherits its appender from a.
     */
    public void testAdditivity1() {
      Logger a = Logger.getLogger("a");
      Logger ab = Logger.getLogger("a.b");
      CountingAppender ca = new CountingAppender();
      ca.activate();
      a.addAppender(ca);
  
      assertEquals(ca.counter, 0);
      ab.debug(MSG);
      assertEquals(ca.counter, 1);
      ab.info(MSG);
      assertEquals(ca.counter, 2);
      ab.warn(MSG);
      assertEquals(ca.counter, 3);
      ab.error(MSG);
      assertEquals(ca.counter, 4);
    }
  
    /**
       Test multiple additivity.
  
     */
    public void testAdditivity2() {
      Logger a = Logger.getLogger("a");
      Logger ab = Logger.getLogger("a.b");
      Logger abc = Logger.getLogger("a.b.c");
      Logger x = Logger.getLogger("x");
  
      CountingAppender ca1 = new CountingAppender();
      ca1.activate();
      CountingAppender ca2 = new CountingAppender();
      ca2.activate();  
      a.addAppender(ca1);
      abc.addAppender(ca2);
  
      assertEquals(ca1.counter, 0);
      assertEquals(ca2.counter, 0);
  
      ab.debug(MSG);
      assertEquals(ca1.counter, 1);
      assertEquals(ca2.counter, 0);
  
      abc.debug(MSG);
      assertEquals(ca1.counter, 2);
      assertEquals(ca2.counter, 1);
  
      x.debug(MSG);
      assertEquals(ca1.counter, 2);
      assertEquals(ca2.counter, 1);
    }
  
    /**
       Test additivity flag.
  
     */
    public void testAdditivity3() {
      Logger root = Logger.getRootLogger();
      Logger a = Logger.getLogger("a");
      Logger ab = Logger.getLogger("a.b");
      Logger abc = Logger.getLogger("a.b.c");
      Logger x = Logger.getLogger("x");
  
      CountingAppender caRoot = new CountingAppender();
      caRoot.activate();
      CountingAppender caA = new CountingAppender();
      caA.activate();
      CountingAppender caABC = new CountingAppender();
      caABC.activate();
      
      root.addAppender(caRoot);
      a.addAppender(caA);
      abc.addAppender(caABC);
  
      assertEquals(caRoot.counter, 0);
      assertEquals(caA.counter, 0);
      assertEquals(caABC.counter, 0);
  
      ab.setAdditivity(false);
  
      a.debug(MSG);
      assertEquals(caRoot.counter, 1);
      assertEquals(caA.counter, 1);
      assertEquals(caABC.counter, 0);
  
      ab.debug(MSG);
      assertEquals(caRoot.counter, 1);
      assertEquals(caA.counter, 1);
      assertEquals(caABC.counter, 0);
  
      abc.debug(MSG);
      assertEquals(caRoot.counter, 1);
      assertEquals(caA.counter, 1);
      assertEquals(caABC.counter, 1);
    }
  
    public void testDisable1() {
      CountingAppender caRoot = new CountingAppender();
      caRoot.activate();
      Logger root = Logger.getRootLogger();
      root.addAppender(caRoot);
  
      LoggerRepository h = LogManager.getLoggerRepository();
  
      //h.disableDebug();
      h.setThreshold((Level) Level.INFO);
      assertEquals(caRoot.counter, 0);
  
      root.trace(MSG);
      assertEquals(caRoot.counter, 0);
  
      root.debug(MSG);
      assertEquals(caRoot.counter, 0);
  
      root.info(MSG);
      assertEquals(caRoot.counter, 1);
      root.log(Level.WARN, MSG);
      assertEquals(caRoot.counter, 2);
      root.warn(MSG);
      assertEquals(caRoot.counter, 3);
  
      //h.disableInfo();
      h.setThreshold((Level) Level.WARN);
  
      root.trace(MSG);
      assertEquals(caRoot.counter, 3);
  
      root.debug(MSG);
      assertEquals(caRoot.counter, 3);
  
      root.info(MSG);
      assertEquals(caRoot.counter, 3);
      root.log(Level.WARN, MSG);
      assertEquals(caRoot.counter, 4);
      root.error(MSG);
      assertEquals(caRoot.counter, 5);
      root.log(Level.ERROR, MSG);
      assertEquals(caRoot.counter, 6);
  
      //h.disableAll();
      h.setThreshold(Level.OFF);
  
      root.trace(MSG);
      assertEquals(caRoot.counter, 6);
  
      root.debug(MSG);
      assertEquals(caRoot.counter, 6);
  
      root.info(MSG);
      assertEquals(caRoot.counter, 6);
      root.log(Level.WARN, MSG);
      assertEquals(caRoot.counter, 6);
      root.error(MSG);
      assertEquals(caRoot.counter, 6);
      root.log(Level.FATAL, MSG);
      assertEquals(caRoot.counter, 6);
      root.log(Level.FATAL, MSG);
      assertEquals(caRoot.counter, 6);
    }
  
    public void testRB1() {
      Logger root = Logger.getRootLogger();
      root.setResourceBundle(rbUS);
  
      ResourceBundle t = root.getResourceBundle();
      assertSame(t, rbUS);
  
      Logger x = Logger.getLogger("x");
      Logger x_y = Logger.getLogger("x.y");
      Logger x_y_z = Logger.getLogger("x.y.z");
  
      t = x.getResourceBundle();
      assertSame(t, rbUS);
      t = x_y.getResourceBundle();
      assertSame(t, rbUS);
      t = x_y_z.getResourceBundle();
      assertSame(t, rbUS);
    }
  
    public void testRB2() {
      Logger root = Logger.getRootLogger();
      root.setResourceBundle(rbUS);
  
      ResourceBundle t = root.getResourceBundle();
      assertSame(t, rbUS);
  
      Logger x = Logger.getLogger("x");
      Logger x_y = Logger.getLogger("x.y");
      Logger x_y_z = Logger.getLogger("x.y.z");
  
      x_y.setResourceBundle(rbFR);
      t = x.getResourceBundle();
      assertSame(t, rbUS);
      t = x_y.getResourceBundle();
      assertSame(t, rbFR);
      t = x_y_z.getResourceBundle();
      assertSame(t, rbFR);
    }
  
    public void testRB3() {
      Logger root = Logger.getRootLogger();
      root.setResourceBundle(rbUS);
  
      ResourceBundle t = root.getResourceBundle();
      assertSame(t, rbUS);
  
      Logger x = Logger.getLogger("x");
      Logger x_y = Logger.getLogger("x.y");
      Logger x_y_z = Logger.getLogger("x.y.z");
  
      x_y.setResourceBundle(rbFR);
      x_y_z.setResourceBundle(rbCH);
      t = x.getResourceBundle();
      assertSame(t, rbUS);
      t = x_y.getResourceBundle();
      assertSame(t, rbFR);
      t = x_y_z.getResourceBundle();
      assertSame(t, rbCH);
    }
  
    public void testExists() {
      Logger a = Logger.getLogger("a");
      Logger a_b = Logger.getLogger("a.b");
      Logger a_b_c = Logger.getLogger("a.b.c");
  
      Logger t;
      t = LogManager.exists("xx");
      assertNull(t);
      t = LogManager.exists("a");
      assertSame(a, t);
      t = LogManager.exists("a.b");
      assertSame(a_b, t);
      t = LogManager.exists("a.b.c");
      assertSame(a_b_c, t);
    }
  
    public void testHierarchy1() {
      Hierarchy h = new Hierarchy(new RootLogger((Level) Level.ERROR));
      Logger a0 = h.getLogger("a");
      assertEquals("a", a0.getName());
      assertNull(a0.getLevel());
      assertSame(Level.ERROR, a0.getEffectiveLevel());
  
      Logger a1 = h.getLogger("a");
      assertSame(a0, a1);
    }
  
    public static Test DISABLEDsuite() {
      TestSuite suite = new TestSuite();
      suite.addTest(new LoggerTest("testAppender1"));
      suite.addTest(new LoggerTest("testAppender2"));
      suite.addTest(new LoggerTest("testAdditivity1"));
      suite.addTest(new LoggerTest("testAdditivity2"));
      suite.addTest(new LoggerTest("testAdditivity3"));
      suite.addTest(new LoggerTest("testDisable1"));
      suite.addTest(new LoggerTest("testRB1"));
      suite.addTest(new LoggerTest("testRB2"));
      suite.addTest(new LoggerTest("testRB3"));
      suite.addTest(new LoggerTest("testExists"));
      suite.addTest(new LoggerTest("testHierarchy1"));
  
      return suite;
    }
  
    private static class CountingAppender extends AppenderSkeleton {
      int counter;
  
      CountingAppender() {
        counter = 0;
      }
  
      public void close() {
      }
  
      public void append(LoggingEvent event) {
        counter++;
      }
    }
  }
  
  // End of class: LoggerTestCase.java
  
  
  
  1.9       +1 -1      logging-log4j/src/java/org/apache/log4j/config/ConfiguratorBase.java
  
  Index: ConfiguratorBase.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/config/ConfiguratorBase.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ConfiguratorBase.java	12 Jan 2005 18:04:41 -0000	1.8
  +++ ConfiguratorBase.java	18 Feb 2005 17:23:44 -0000	1.9
  @@ -108,7 +108,7 @@
       appender.setLayout(
         new PatternLayout("LOG4J-INTERNAL: %d %level [%t] %c#%M:%L)- %m%n"));
       appender.setName(Constants.TEMP_CONSOLE_APPENDER_NAME);
  -    appender.activateOptions();
  +    appender.activate();
       ll.addAppender(appender);
     }
   
  
  
  
  1.18      +45 -46    logging-log4j/src/java/org/apache/log4j/db/DBAppender.java
  
  Index: DBAppender.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/db/DBAppender.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- DBAppender.java	6 Jan 2005 23:15:53 -0000	1.17
  +++ DBAppender.java	18 Feb 2005 17:23:45 -0000	1.18
  @@ -31,6 +31,7 @@
   import java.util.Iterator;
   import java.util.Set;
   
  +
   /**
    * The DBAppender inserts loggin events into three database tables in a format
    * independent of the Java programming language. The three tables that
  @@ -41,7 +42,7 @@
    * for your particular type of database system is missing, it should be quite
    * easy to write one, taking example on the already existing scripts. If you
    * send them to us, we will gladly include missing scripts in future releases.
  - * 
  + *
    * <p>
    * If the JDBC driver you are using supports the
    * {@link java.sql.Statement#getGeneratedKeys}method introduced in JDBC 3.0
  @@ -52,7 +53,7 @@
    * not support the {@link java.sql.Statement#getGeneratedKeys getGeneratedKeys}
    * method.
    * </p>
  - * 
  + *
    * <table border="1" cellpadding="4">
    * <tr>
    * <th>RDBMS</th>
  @@ -89,7 +90,7 @@
    *    <td align="center">NO</td>
    *    <td>present and used</td>
    * <tr>
  - * 
  + *
    * </table>
    * <p>
    * <b>Performance: </b> Experiments show that writing a single event into the
  @@ -97,32 +98,23 @@
    * connections are used, this figure drops to under 10 milliseconds. Note that
    * most JDBC drivers already ship with connection pooling support.
    * </p>
  - * 
  - * 
  - * 
  + *
  + *
  + *
    * <p>
    * <b>Configuration </b> DBAppender can be configured programmatically, or using
    * {@link org.apache.log4j.joran.JoranConfigurator JoranConfigurator}. Example
    * scripts can be found in the <em>tests/input/db</em> directory.
  - * 
  + *
    * @author Ceki G&uuml;lc&uuml;
    * @author Ray DeCampo
    * @since 1.3
    */
   public class DBAppender extends AppenderSkeleton {
  -
  -  ConnectionSource connectionSource;
  -
  -  boolean cnxSupportsGetGeneratedKeys = false;
  -  boolean cnxSupportsBatchUpdates = false;
  -  SQLDialect sqlDialect;
  -
  -  boolean locationInfo = false;
  -
  -  static final String insertPropertiesSQL = "INSERT INTO  logging_event_property (event_id, mapped_key, mapped_value) VALUES (?, ?, ?)";
  -
  -  static final String insertExceptionSQL = "INSERT INTO  logging_event_exception (event_id, i, trace_line) VALUES (?, ?, ?)";
  -
  +  static final String insertPropertiesSQL =
  +    "INSERT INTO  logging_event_property (event_id, mapped_key, mapped_value) VALUES (?, ?, ?)";
  +  static final String insertExceptionSQL =
  +    "INSERT INTO  logging_event_exception (event_id, i, trace_line) VALUES (?, ?, ?)";
     static final String insertSQL;
   
     static {
  @@ -144,20 +136,33 @@
       insertSQL = sql.toString();
     }
   
  +  ConnectionSource connectionSource;
  +  boolean cnxSupportsGetGeneratedKeys = false;
  +  boolean cnxSupportsBatchUpdates = false;
  +  SQLDialect sqlDialect;
  +  boolean locationInfo = false;
  +
     public DBAppender() {
     }
   
  -  public void activateOptions() {
  +  public void activate() {
       getLogger().debug("DBAppender.activateOptions called");
   
  -    if (connectionSource == null) { throw new IllegalStateException(
  -        "DBAppender cannot function without a connection source"); }
  +    if (connectionSource == null) {
  +      throw new IllegalStateException(
  +        "DBAppender cannot function without a connection source");
  +    }
   
       sqlDialect = Util.getDialectFromCode(connectionSource.getSQLDialectCode());
       cnxSupportsGetGeneratedKeys = connectionSource.supportsGetGeneratedKeys();
       cnxSupportsBatchUpdates = connectionSource.supportsBatchUpdates();
  -    if (!cnxSupportsGetGeneratedKeys && sqlDialect == null) { throw new IllegalStateException(
  -        "DBAppender cannot function if the JDBC driver does not support getGeneratedKeys method *and* without a specific SQL dialect"); }
  +    if (!cnxSupportsGetGeneratedKeys && (sqlDialect == null)) {
  +      throw new IllegalStateException(
  +        "DBAppender cannot function if the JDBC driver does not support getGeneratedKeys method *and* without a specific SQL dialect");
  +    }
  +    
  +    // all nice and dandy on the eastern front
  +    super.activate();
     }
   
     /**
  @@ -182,8 +187,8 @@
         connection = connectionSource.getConnection();
         connection.setAutoCommit(false);
   
  -      PreparedStatement insertStatement = connection
  -          .prepareStatement(insertSQL);
  +      PreparedStatement insertStatement =
  +        connection.prepareStatement(insertSQL);
         insertStatement.setLong(1, event.getSequenceNumber());
         insertStatement.setLong(2, event.getTimeStamp());
         insertStatement.setString(3, event.getRenderedMessage());
  @@ -220,6 +225,7 @@
         } else {
           rs = idStatement.executeQuery(sqlDialect.getSelectInsertId());
         }
  +
         // A ResultSet cursor is initially positioned before the first row; the 
         // first call to the method next makes the first row the current row
         rs.next();
  @@ -232,29 +238,29 @@
         Set propertiesKeys = event.getPropertyKeySet();
   
         if (propertiesKeys.size() > 0) {
  -
  -        PreparedStatement insertPropertiesStatement = connection
  -            .prepareStatement(insertPropertiesSQL);
  +        PreparedStatement insertPropertiesStatement =
  +          connection.prepareStatement(insertPropertiesSQL);
   
           for (Iterator i = propertiesKeys.iterator(); i.hasNext();) {
             String key = (String) i.next();
             String value = (String) event.getProperty(key);
  +
             //LogLog.info("id " + eventId + ", key " + key + ", value " + value);
             insertPropertiesStatement.setInt(1, eventId);
             insertPropertiesStatement.setString(2, key);
             insertPropertiesStatement.setString(3, value);
  -          
  -          if(cnxSupportsBatchUpdates) {
  +
  +          if (cnxSupportsBatchUpdates) {
               insertPropertiesStatement.addBatch();
             } else {
               insertPropertiesStatement.execute();
             }
           }
   
  -        if(cnxSupportsBatchUpdates) {
  +        if (cnxSupportsBatchUpdates) {
             insertPropertiesStatement.executeBatch();
           }
  -        
  +
           insertPropertiesStatement.close();
           insertPropertiesStatement = null;
         }
  @@ -264,20 +270,20 @@
         if (strRep != null) {
           getLogger().debug("Logging an exception");
   
  -        PreparedStatement insertExceptionStatement = connection
  -            .prepareStatement(insertExceptionSQL);
  +        PreparedStatement insertExceptionStatement =
  +          connection.prepareStatement(insertExceptionSQL);
   
           for (short i = 0; i < strRep.length; i++) {
             insertExceptionStatement.setInt(1, eventId);
             insertExceptionStatement.setShort(2, i);
             insertExceptionStatement.setString(3, strRep[i]);
  -          if(cnxSupportsBatchUpdates) {
  +          if (cnxSupportsBatchUpdates) {
               insertExceptionStatement.addBatch();
             } else {
               insertExceptionStatement.execute();
             }
           }
  -        if(cnxSupportsBatchUpdates) {
  +        if (cnxSupportsBatchUpdates) {
             insertExceptionStatement.executeBatch();
           }
           insertExceptionStatement.close();
  @@ -296,13 +302,6 @@
       closed = true;
     }
   
  -  /*
  -   * The DBAppender does not require a layout.
  -   */
  -  public boolean requiresLayout() {
  -    return false;
  -  }
  -
     /**
      * Returns value of the <b>LocationInfo </b> property which determines whether
      * caller's location info is written to the database.
  @@ -319,4 +318,4 @@
     public void setLocationInfo(boolean locationInfo) {
       this.locationInfo = locationInfo;
     }
  -}
  \ No newline at end of file
  +}
  
  
  
  1.5       +27 -1     logging-log4j/src/java/org/apache/log4j/spi/ComponentBase.java
  
  Index: ComponentBase.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/spi/ComponentBase.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ComponentBase.java	6 Jan 2005 22:38:35 -0000	1.4
  +++ ComponentBase.java	18 Feb 2005 17:23:45 -0000	1.5
  @@ -8,6 +8,7 @@
   
   import org.apache.log4j.LogManager;
   import org.apache.ugli.ULogger;
  +import org.apache.ugli.impl.NOPLogger;
   
   
   /**
  @@ -18,9 +19,20 @@
    */
   public class ComponentBase implements Component {
   
  +  private final static int ERROR_COUNT_LIMIT = 3;
  +  
     protected LoggerRepository repository;
     private ULogger logger;
  -
  +  private int errorCount = 0;
  +  
  +  
  +  /**
  +   * Called by derived classes when they deem that the component has recovered
  +   * from an erroneous state.
  +   */
  +  protected void resetErrorCount() {
  +    errorCount = 0;
  +  }
     /**
      * Set the owning repository. The owning repository cannot be set more than
      * once.
  @@ -59,4 +71,18 @@
       }
       return logger;
     } 
  +  
  +  /**
  +   * Frequently called methods in log4j components can invoke this method in
  +   * order to avoid flooding the output when logging lasting error conditions. 
  +   * 
  +   * @return a regular logger, or a NOPLogger if called too frequently.
  +   */
  +  protected ULogger getNonFloodingLogger() {
  +    if(errorCount++ >= ERROR_COUNT_LIMIT) {
  +      return NOPLogger.NOP_LOGGER;
  +    } else {
  +      return getLogger();
  +    }
  +  } 
   }
  
  
  
  1.1                  logging-log4j/tests/src/java/org/apache/log4j/xml/DOMTest.java
  
  Index: DOMTest.java
  ===================================================================
  /*
   * Copyright 1999-2005 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  package org.apache.log4j.xml;
  
  import java.util.List;
  
  import junit.framework.Test;
  import junit.framework.TestCase;
  import junit.framework.TestSuite;
  
  import org.apache.log4j.LogManager;
  import org.apache.log4j.Logger;
  import org.apache.log4j.Level;
  import org.apache.log4j.joran.JoranConfigurator;
  import org.apache.log4j.spi.ErrorItem;
  import org.apache.log4j.util.Filter;
  import org.apache.log4j.util.JunitTestRunnerFilter;
  import org.apache.log4j.util.LineNumberFilter;
  import org.apache.log4j.util.SunReflectFilter;
  import org.apache.log4j.util.ControlFilter;
  import org.apache.log4j.util.ISO8601Filter;
  import org.apache.log4j.util.Transformer;
  import org.apache.log4j.util.Compare;
  import java.io.File;
  
  public class DOMTest extends TestCase {
  
    static String TEMP_A1 = "output/temp.A1";
    static String TEMP_A2 = "output/temp.A2";
    static String FILTERED_A1 = "output/filtered.A1";
    static String FILTERED_A2 = "output/filtered.A2";
  
  
    static String EXCEPTION1 = "java.lang.Exception: Just testing";
    static String EXCEPTION2 = "\\s*at .*\\(.*:\\d{1,4}\\)";
    static String EXCEPTION3 = "\\s*at .*\\(Native Method\\)";
  
    static String TEST1_1A_PAT = 
                         "(DEBUG|INFO |WARN |ERROR|FATAL) \\w*\\.\\w* - Message \\d";
  
    static String TEST1_1B_PAT = "(DEBUG|INFO |WARN |ERROR|FATAL) root - Message \\d";
  
    static String TEST1_2_PAT = "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2},\\d{3} "+
                          "\\[main]\\ (DEBUG|INFO|WARN|ERROR|FATAL) .* - Message \\d";
  
  
  
    Logger root; 
    Logger logger;
  
    public DOMTest(String name) {
      super(name);
    }
  
    public void setUp() {
      root = Logger.getRootLogger();
      logger = Logger.getLogger(DOMTest.class);
    }
   
    public void tearDown() {  
      root.getLoggerRepository().resetConfiguration();
    }
  
    public void test1() throws Exception {
      //org.apache.log4j.BasicConfigurator.configure();
      JoranConfigurator jc = new JoranConfigurator();
      jc.doConfigure("input/xml/DOMTest1.xml", LogManager.getLoggerRepository());
      dumpErrors(jc.getErrorList());
      common();
  
      ControlFilter cf1 = new ControlFilter(new String[]{TEST1_1A_PAT, TEST1_1B_PAT, 
  					       EXCEPTION1, EXCEPTION2, EXCEPTION3});
  
      ControlFilter cf2 = new ControlFilter(new String[]{TEST1_2_PAT, 
  					       EXCEPTION1, EXCEPTION2, EXCEPTION3});
  
      Transformer.transform(TEMP_A1, FILTERED_A1, new Filter[] {cf1, 
  							new LineNumberFilter(), 
                new SunReflectFilter(), 
                new JunitTestRunnerFilter()});
  
      Transformer.transform(TEMP_A2, FILTERED_A2, new Filter[] {cf2,
                                        new LineNumberFilter(), new ISO8601Filter(),
                                        new SunReflectFilter(), new JunitTestRunnerFilter()});
  
      assertTrue(Compare.compare(FILTERED_A1, "witness/xml/dom.A1.1"));
      assertTrue(Compare.compare(FILTERED_A2, "witness/xml/dom.A2.1"));
    }
  
    /**
     * Identical test except that backslashes are used instead of
     * forward slashes on all file specifications.  Test is 
     * only applicable to Windows.
     * 
     * @throws Exception Any exception will cause test to fail
     */
    public void test2() throws Exception {
    	if (File.separatorChar == '\\') {
   	    JoranConfigurator jc = new JoranConfigurator();
  	    jc.doConfigure("input\\xml\\DOMTest2.xml", LogManager.getLoggerRepository());
  	    dumpErrors(jc.getErrorList());
  	    common();
  	
  	    ControlFilter cf1 = new ControlFilter(new String[]{TEST1_1A_PAT, TEST1_1B_PAT, 
  						       EXCEPTION1, EXCEPTION2, EXCEPTION3});
  	
  	    ControlFilter cf2 = new ControlFilter(new String[]{TEST1_2_PAT, 
  						       EXCEPTION1, EXCEPTION2, EXCEPTION3});
  	
  	    Transformer.transform(TEMP_A1 + ".2", FILTERED_A1 + ".2", new Filter[] {cf1, 
  								new LineNumberFilter(), 
  	              new SunReflectFilter(), 
  	              new JunitTestRunnerFilter()});
  	
  	    Transformer.transform(TEMP_A2 + ".2", FILTERED_A2 + ".2", new Filter[] {cf2,
  	                                      new LineNumberFilter(), new ISO8601Filter(),
  	                                      new SunReflectFilter(), new JunitTestRunnerFilter()});
  	
  	    assertTrue(Compare.compare(FILTERED_A1, "witness/xml/dom.A1.2"));
  	    assertTrue(Compare.compare(FILTERED_A2, "witness/xml/dom.A2.2"));
    	}
    }
    
    
   
    void common() {
      int i = -1;
   
      logger.debug("Message " + ++i);
      root.debug("Message " + i);        
  
      logger.info ("Message " + ++i);
      root.info("Message " + i);        
  
      logger.warn ("Message " + ++i);
      root.warn("Message " + i);        
  
      logger.error("Message " + ++i);
      root.error("Message " + i);
      
      logger.log(Level.FATAL, "Message " + ++i);
      root.log(Level.FATAL, "Message " + i);    
      
      Exception e = new Exception("Just testing");
      logger.debug("Message " + ++i, e);
      root.debug("Message " + i, e);
      
      logger.error("Message " + ++i, e);
      root.error("Message " + i, e);    
    }
  
    void dumpErrors(List errorList) {
      for(int i = 0; i < errorList.size(); i++) {
        ErrorItem ei = (ErrorItem) errorList.get(i);
        System.out.println(ei);
        Throwable t = ei.getException();
        if(t != null) {
          t.printStackTrace(System.out);
        }
      }
    }
  
    public static Test suite() {
      TestSuite suite = new TestSuite();
      suite.addTest(new DOMTest("test1"));
      //suite.addTest(new DOMTest("test2"));
      return suite;
    }
  
  }
  
  
  
  1.2       +26 -26    logging-log4j/tests/witness/xml/dom.A1.2
  
  Index: dom.A1.2
  ===================================================================
  RCS file: /home/cvs/logging-log4j/tests/witness/xml/dom.A1.2,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- dom.A1.2	11 Feb 2005 18:11:44 -0000	1.1
  +++ dom.A1.2	18 Feb 2005 17:23:45 -0000	1.2
  @@ -1,22 +1,22 @@
  -DEBUG xml.DOMTestCase - Message 0
  -DEBUG xml.DOMTestCase - Message 0
  +DEBUG xml.DOMTest - Message 0
  +DEBUG xml.DOMTest - Message 0
   DEBUG root - Message 0
  -INFO  xml.DOMTestCase - Message 1
  -INFO  xml.DOMTestCase - Message 1
  +INFO  xml.DOMTest - Message 1
  +INFO  xml.DOMTest - Message 1
   INFO  root - Message 1
  -WARN  xml.DOMTestCase - Message 2
  -WARN  xml.DOMTestCase - Message 2
  +WARN  xml.DOMTest - Message 2
  +WARN  xml.DOMTest - Message 2
   WARN  root - Message 2
  -ERROR xml.DOMTestCase - Message 3
  -ERROR xml.DOMTestCase - Message 3
  +ERROR xml.DOMTest - Message 3
  +ERROR xml.DOMTest - Message 3
   ERROR root - Message 3
  -FATAL xml.DOMTestCase - Message 4
  -FATAL xml.DOMTestCase - Message 4
  +FATAL xml.DOMTest - Message 4
  +FATAL xml.DOMTest - Message 4
   FATAL root - Message 4
  -DEBUG xml.DOMTestCase - Message 5
  +DEBUG xml.DOMTest - Message 5
   java.lang.Exception: Just testing
  -	at org.apache.log4j.xml.DOMTestCase.common(X)
  -	at org.apache.log4j.xml.DOMTestCase.test2(X)
  +	at org.apache.log4j.xml.DOMTest.common(X)
  +	at org.apache.log4j.xml.DOMTest.test2(X)
   	at java.lang.reflect.Method.invoke(X)
   	at junit.framework.TestCase.runTest(X)
   	at junit.framework.TestCase.runBare(X)
  @@ -26,10 +26,10 @@
   	at junit.framework.TestCase.run(X)
   	at junit.framework.TestSuite.runTest(X)
   	at junit.framework.TestSuite.run(X)
  -DEBUG xml.DOMTestCase - Message 5
  +DEBUG xml.DOMTest - Message 5
   java.lang.Exception: Just testing
  -	at org.apache.log4j.xml.DOMTestCase.common(X)
  -	at org.apache.log4j.xml.DOMTestCase.test2(X)
  +	at org.apache.log4j.xml.DOMTest.common(X)
  +	at org.apache.log4j.xml.DOMTest.test2(X)
   	at java.lang.reflect.Method.invoke(X)
   	at junit.framework.TestCase.runTest(X)
   	at junit.framework.TestCase.runBare(X)
  @@ -41,8 +41,8 @@
   	at junit.framework.TestSuite.run(X)
   DEBUG root - Message 5
   java.lang.Exception: Just testing
  -	at org.apache.log4j.xml.DOMTestCase.common(X)
  -	at org.apache.log4j.xml.DOMTestCase.test2(X)
  +	at org.apache.log4j.xml.DOMTest.common(X)
  +	at org.apache.log4j.xml.DOMTest.test2(X)
   	at java.lang.reflect.Method.invoke(X)
   	at junit.framework.TestCase.runTest(X)
   	at junit.framework.TestCase.runBare(X)
  @@ -52,10 +52,10 @@
   	at junit.framework.TestCase.run(X)
   	at junit.framework.TestSuite.runTest(X)
   	at junit.framework.TestSuite.run(X)
  -ERROR xml.DOMTestCase - Message 6
  +ERROR xml.DOMTest - Message 6
   java.lang.Exception: Just testing
  -	at org.apache.log4j.xml.DOMTestCase.common(X)
  -	at org.apache.log4j.xml.DOMTestCase.test2(X)
  +	at org.apache.log4j.xml.DOMTest.common(X)
  +	at org.apache.log4j.xml.DOMTest.test2(X)
   	at java.lang.reflect.Method.invoke(X)
   	at junit.framework.TestCase.runTest(X)
   	at junit.framework.TestCase.runBare(X)
  @@ -65,10 +65,10 @@
   	at junit.framework.TestCase.run(X)
   	at junit.framework.TestSuite.runTest(X)
   	at junit.framework.TestSuite.run(X)
  -ERROR xml.DOMTestCase - Message 6
  +ERROR xml.DOMTest - Message 6
   java.lang.Exception: Just testing
  -	at org.apache.log4j.xml.DOMTestCase.common(X)
  -	at org.apache.log4j.xml.DOMTestCase.test2(X)
  +	at org.apache.log4j.xml.DOMTest.common(X)
  +	at org.apache.log4j.xml.DOMTest.test2(X)
   	at java.lang.reflect.Method.invoke(X)
   	at junit.framework.TestCase.runTest(X)
   	at junit.framework.TestCase.runBare(X)
  @@ -80,8 +80,8 @@
   	at junit.framework.TestSuite.run(X)
   ERROR root - Message 6
   java.lang.Exception: Just testing
  -	at org.apache.log4j.xml.DOMTestCase.common(X)
  -	at org.apache.log4j.xml.DOMTestCase.test2(X)
  +	at org.apache.log4j.xml.DOMTest.common(X)
  +	at org.apache.log4j.xml.DOMTest.test2(X)
   	at java.lang.reflect.Method.invoke(X)
   	at junit.framework.TestCase.runTest(X)
   	at junit.framework.TestCase.runBare(X)
  
  
  
  1.2       +15 -15    logging-log4j/tests/witness/xml/dom.A2.1
  
  Index: dom.A2.1
  ===================================================================
  RCS file: /home/cvs/logging-log4j/tests/witness/xml/dom.A2.1,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- dom.A2.1	20 Nov 2004 19:06:58 -0000	1.1
  +++ dom.A2.1	18 Feb 2005 17:23:45 -0000	1.2
  @@ -1,17 +1,17 @@
  - [main] DEBUG org.apache.log4j.xml.DOMTestCase - Message 0
  + [main] DEBUG org.apache.log4j.xml.DOMTest - Message 0
    [main] DEBUG root - Message 0
  - [main] INFO org.apache.log4j.xml.DOMTestCase - Message 1
  + [main] INFO org.apache.log4j.xml.DOMTest - Message 1
    [main] INFO root - Message 1
  - [main] WARN org.apache.log4j.xml.DOMTestCase - Message 2
  + [main] WARN org.apache.log4j.xml.DOMTest - Message 2
    [main] WARN root - Message 2
  - [main] ERROR org.apache.log4j.xml.DOMTestCase - Message 3
  + [main] ERROR org.apache.log4j.xml.DOMTest - Message 3
    [main] ERROR root - Message 3
  - [main] FATAL org.apache.log4j.xml.DOMTestCase - Message 4
  + [main] FATAL org.apache.log4j.xml.DOMTest - Message 4
    [main] FATAL root - Message 4
  - [main] DEBUG org.apache.log4j.xml.DOMTestCase - Message 5
  + [main] DEBUG org.apache.log4j.xml.DOMTest - Message 5
   java.lang.Exception: Just testing
  -	at org.apache.log4j.xml.DOMTestCase.common(X)
  -	at org.apache.log4j.xml.DOMTestCase.test1(X)
  +	at org.apache.log4j.xml.DOMTest.common(X)
  +	at org.apache.log4j.xml.DOMTest.test1(X)
   	at java.lang.reflect.Method.invoke(X)
   	at junit.framework.TestCase.runTest(X)
   	at junit.framework.TestCase.runBare(X)
  @@ -23,8 +23,8 @@
   	at junit.framework.TestSuite.run(X)
    [main] DEBUG root - Message 5
   java.lang.Exception: Just testing
  -	at org.apache.log4j.xml.DOMTestCase.common(X)
  -	at org.apache.log4j.xml.DOMTestCase.test1(X)
  +	at org.apache.log4j.xml.DOMTest.common(X)
  +	at org.apache.log4j.xml.DOMTest.test1(X)
   	at java.lang.reflect.Method.invoke(X)
   	at junit.framework.TestCase.runTest(X)
   	at junit.framework.TestCase.runBare(X)
  @@ -34,10 +34,10 @@
   	at junit.framework.TestCase.run(X)
   	at junit.framework.TestSuite.runTest(X)
   	at junit.framework.TestSuite.run(X)
  - [main] ERROR org.apache.log4j.xml.DOMTestCase - Message 6
  + [main] ERROR org.apache.log4j.xml.DOMTest - Message 6
   java.lang.Exception: Just testing
  -	at org.apache.log4j.xml.DOMTestCase.common(X)
  -	at org.apache.log4j.xml.DOMTestCase.test1(X)
  +	at org.apache.log4j.xml.DOMTest.common(X)
  +	at org.apache.log4j.xml.DOMTest.test1(X)
   	at java.lang.reflect.Method.invoke(X)
   	at junit.framework.TestCase.runTest(X)
   	at junit.framework.TestCase.runBare(X)
  @@ -49,8 +49,8 @@
   	at junit.framework.TestSuite.run(X)
    [main] ERROR root - Message 6
   java.lang.Exception: Just testing
  -	at org.apache.log4j.xml.DOMTestCase.common(X)
  -	at org.apache.log4j.xml.DOMTestCase.test1(X)
  +	at org.apache.log4j.xml.DOMTest.common(X)
  +	at org.apache.log4j.xml.DOMTest.test1(X)
   	at java.lang.reflect.Method.invoke(X)
   	at junit.framework.TestCase.runTest(X)
   	at junit.framework.TestCase.runBare(X)
  
  
  
  1.2       +15 -15    logging-log4j/tests/witness/xml/dom.A2.2
  
  Index: dom.A2.2
  ===================================================================
  RCS file: /home/cvs/logging-log4j/tests/witness/xml/dom.A2.2,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- dom.A2.2	11 Feb 2005 18:11:44 -0000	1.1
  +++ dom.A2.2	18 Feb 2005 17:23:45 -0000	1.2
  @@ -1,17 +1,17 @@
  - [main] DEBUG org.apache.log4j.xml.DOMTestCase - Message 0
  + [main] DEBUG org.apache.log4j.xml.DOMTest - Message 0
    [main] DEBUG root - Message 0
  - [main] INFO org.apache.log4j.xml.DOMTestCase - Message 1
  + [main] INFO org.apache.log4j.xml.DOMTest - Message 1
    [main] INFO root - Message 1
  - [main] WARN org.apache.log4j.xml.DOMTestCase - Message 2
  + [main] WARN org.apache.log4j.xml.DOMTest - Message 2
    [main] WARN root - Message 2
  - [main] ERROR org.apache.log4j.xml.DOMTestCase - Message 3
  + [main] ERROR org.apache.log4j.xml.DOMTest - Message 3
    [main] ERROR root - Message 3
  - [main] FATAL org.apache.log4j.xml.DOMTestCase - Message 4
  + [main] FATAL org.apache.log4j.xml.DOMTest - Message 4
    [main] FATAL root - Message 4
  - [main] DEBUG org.apache.log4j.xml.DOMTestCase - Message 5
  + [main] DEBUG org.apache.log4j.xml.DOMTest - Message 5
   java.lang.Exception: Just testing
  -	at org.apache.log4j.xml.DOMTestCase.common(X)
  -	at org.apache.log4j.xml.DOMTestCase.test2(X)
  +	at org.apache.log4j.xml.DOMTest.common(X)
  +	at org.apache.log4j.xml.DOMTest.test2(X)
   	at java.lang.reflect.Method.invoke(X)
   	at junit.framework.TestCase.runTest(X)
   	at junit.framework.TestCase.runBare(X)
  @@ -23,8 +23,8 @@
   	at junit.framework.TestSuite.run(X)
    [main] DEBUG root - Message 5
   java.lang.Exception: Just testing
  -	at org.apache.log4j.xml.DOMTestCase.common(X)
  -	at org.apache.log4j.xml.DOMTestCase.test2(X)
  +	at org.apache.log4j.xml.DOMTest.common(X)
  +	at org.apache.log4j.xml.DOMTest.test2(X)
   	at java.lang.reflect.Method.invoke(X)
   	at junit.framework.TestCase.runTest(X)
   	at junit.framework.TestCase.runBare(X)
  @@ -34,10 +34,10 @@
   	at junit.framework.TestCase.run(X)
   	at junit.framework.TestSuite.runTest(X)
   	at junit.framework.TestSuite.run(X)
  - [main] ERROR org.apache.log4j.xml.DOMTestCase - Message 6
  + [main] ERROR org.apache.log4j.xml.DOMTest - Message 6
   java.lang.Exception: Just testing
  -	at org.apache.log4j.xml.DOMTestCase.common(X)
  -	at org.apache.log4j.xml.DOMTestCase.test2(X)
  +	at org.apache.log4j.xml.DOMTest.common(X)
  +	at org.apache.log4j.xml.DOMTest.test2(X)
   	at java.lang.reflect.Method.invoke(X)
   	at junit.framework.TestCase.runTest(X)
   	at junit.framework.TestCase.runBare(X)
  @@ -49,8 +49,8 @@
   	at junit.framework.TestSuite.run(X)
    [main] ERROR root - Message 6
   java.lang.Exception: Just testing
  -	at org.apache.log4j.xml.DOMTestCase.common(X)
  -	at org.apache.log4j.xml.DOMTestCase.test2(X)
  +	at org.apache.log4j.xml.DOMTest.common(X)
  +	at org.apache.log4j.xml.DOMTest.test2(X)
   	at java.lang.reflect.Method.invoke(X)
   	at junit.framework.TestCase.runTest(X)
   	at junit.framework.TestCase.runBare(X)
  
  
  
  1.2       +26 -26    logging-log4j/tests/witness/xml/dom.A1.1
  
  Index: dom.A1.1
  ===================================================================
  RCS file: /home/cvs/logging-log4j/tests/witness/xml/dom.A1.1,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- dom.A1.1	20 Nov 2004 19:06:58 -0000	1.1
  +++ dom.A1.1	18 Feb 2005 17:23:45 -0000	1.2
  @@ -1,22 +1,22 @@
  -DEBUG xml.DOMTestCase - Message 0
  -DEBUG xml.DOMTestCase - Message 0
  +DEBUG xml.DOMTest - Message 0
  +DEBUG xml.DOMTest - Message 0
   DEBUG root - Message 0
  -INFO  xml.DOMTestCase - Message 1
  -INFO  xml.DOMTestCase - Message 1
  +INFO  xml.DOMTest - Message 1
  +INFO  xml.DOMTest - Message 1
   INFO  root - Message 1
  -WARN  xml.DOMTestCase - Message 2
  -WARN  xml.DOMTestCase - Message 2
  +WARN  xml.DOMTest - Message 2
  +WARN  xml.DOMTest - Message 2
   WARN  root - Message 2
  -ERROR xml.DOMTestCase - Message 3
  -ERROR xml.DOMTestCase - Message 3
  +ERROR xml.DOMTest - Message 3
  +ERROR xml.DOMTest - Message 3
   ERROR root - Message 3
  -FATAL xml.DOMTestCase - Message 4
  -FATAL xml.DOMTestCase - Message 4
  +FATAL xml.DOMTest - Message 4
  +FATAL xml.DOMTest - Message 4
   FATAL root - Message 4
  -DEBUG xml.DOMTestCase - Message 5
  +DEBUG xml.DOMTest - Message 5
   java.lang.Exception: Just testing
  -	at org.apache.log4j.xml.DOMTestCase.common(X)
  -	at org.apache.log4j.xml.DOMTestCase.test1(X)
  +	at org.apache.log4j.xml.DOMTest.common(X)
  +	at org.apache.log4j.xml.DOMTest.test1(X)
   	at java.lang.reflect.Method.invoke(X)
   	at junit.framework.TestCase.runTest(X)
   	at junit.framework.TestCase.runBare(X)
  @@ -26,10 +26,10 @@
   	at junit.framework.TestCase.run(X)
   	at junit.framework.TestSuite.runTest(X)
   	at junit.framework.TestSuite.run(X)
  -DEBUG xml.DOMTestCase - Message 5
  +DEBUG xml.DOMTest - Message 5
   java.lang.Exception: Just testing
  -	at org.apache.log4j.xml.DOMTestCase.common(X)
  -	at org.apache.log4j.xml.DOMTestCase.test1(X)
  +	at org.apache.log4j.xml.DOMTest.common(X)
  +	at org.apache.log4j.xml.DOMTest.test1(X)
   	at java.lang.reflect.Method.invoke(X)
   	at junit.framework.TestCase.runTest(X)
   	at junit.framework.TestCase.runBare(X)
  @@ -41,8 +41,8 @@
   	at junit.framework.TestSuite.run(X)
   DEBUG root - Message 5
   java.lang.Exception: Just testing
  -	at org.apache.log4j.xml.DOMTestCase.common(X)
  -	at org.apache.log4j.xml.DOMTestCase.test1(X)
  +	at org.apache.log4j.xml.DOMTest.common(X)
  +	at org.apache.log4j.xml.DOMTest.test1(X)
   	at java.lang.reflect.Method.invoke(X)
   	at junit.framework.TestCase.runTest(X)
   	at junit.framework.TestCase.runBare(X)
  @@ -52,10 +52,10 @@
   	at junit.framework.TestCase.run(X)
   	at junit.framework.TestSuite.runTest(X)
   	at junit.framework.TestSuite.run(X)
  -ERROR xml.DOMTestCase - Message 6
  +ERROR xml.DOMTest - Message 6
   java.lang.Exception: Just testing
  -	at org.apache.log4j.xml.DOMTestCase.common(X)
  -	at org.apache.log4j.xml.DOMTestCase.test1(X)
  +	at org.apache.log4j.xml.DOMTest.common(X)
  +	at org.apache.log4j.xml.DOMTest.test1(X)
   	at java.lang.reflect.Method.invoke(X)
   	at junit.framework.TestCase.runTest(X)
   	at junit.framework.TestCase.runBare(X)
  @@ -65,10 +65,10 @@
   	at junit.framework.TestCase.run(X)
   	at junit.framework.TestSuite.runTest(X)
   	at junit.framework.TestSuite.run(X)
  -ERROR xml.DOMTestCase - Message 6
  +ERROR xml.DOMTest - Message 6
   java.lang.Exception: Just testing
  -	at org.apache.log4j.xml.DOMTestCase.common(X)
  -	at org.apache.log4j.xml.DOMTestCase.test1(X)
  +	at org.apache.log4j.xml.DOMTest.common(X)
  +	at org.apache.log4j.xml.DOMTest.test1(X)
   	at java.lang.reflect.Method.invoke(X)
   	at junit.framework.TestCase.runTest(X)
   	at junit.framework.TestCase.runBare(X)
  @@ -80,8 +80,8 @@
   	at junit.framework.TestSuite.run(X)
   ERROR root - Message 6
   java.lang.Exception: Just testing
  -	at org.apache.log4j.xml.DOMTestCase.common(X)
  -	at org.apache.log4j.xml.DOMTestCase.test1(X)
  +	at org.apache.log4j.xml.DOMTest.common(X)
  +	at org.apache.log4j.xml.DOMTest.test1(X)
   	at java.lang.reflect.Method.invoke(X)
   	at junit.framework.TestCase.runTest(X)
   	at junit.framework.TestCase.runBare(X)
  
  
  
  1.37      +1 -2      logging-log4j/src/java/org/apache/log4j/joran/JoranConfigurator.java
  
  Index: JoranConfigurator.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/joran/JoranConfigurator.java,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- JoranConfigurator.java	12 Jan 2005 15:08:26 -0000	1.36
  +++ JoranConfigurator.java	18 Feb 2005 17:23:45 -0000	1.37
  @@ -60,14 +60,13 @@
   import javax.xml.parsers.SAXParser;
   import javax.xml.parsers.SAXParserFactory;
   
  -
   /**
    *
    * A JoranConfigurator instance should not be used more than once to
    * configure a LoggerRepository.
    *
    * @author Curt Arnold
  - * @author Ceki G&uuml;lc&uuml;  
  + * @author <a href="http://www.qos.ch/log4j/">Ceki G&uuml;lc&uuml;</a>
    */
   public class JoranConfigurator extends ConfiguratorBase {
     Interpreter joranInterpreter;
  
  
  
  1.6       +7 -8      logging-log4j/tests/src/java/org/apache/log4j/helpers/OptionSubstitutionTest.java
  
  Index: OptionSubstitutionTest.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/tests/src/java/org/apache/log4j/helpers/OptionSubstitutionTest.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- OptionSubstitutionTest.java	11 Feb 2005 23:33:38 -0000	1.5
  +++ OptionSubstitutionTest.java	18 Feb 2005 17:23:45 -0000	1.6
  @@ -5,7 +5,6 @@
   import junit.framework.TestSuite;
   import junit.framework.Test;
   import java.util.Properties;
  -import org.apache.log4j.FileAppender;
   
   /**
    * Test variable substitution code in OptionConverter.substVars method.
  @@ -135,22 +134,22 @@
      * @since 1.3
      */
     public void testStripDuplicateBackslashes() {
  -     assertEquals("\\foo\\bar\\foo", FileAppender.stripDuplicateBackslashes("\\foo\\bar\\foo"));
  -     assertEquals("\\foo\\bar\\foo\\", FileAppender.stripDuplicateBackslashes("\\\\foo\\\\bar\\\\foo\\\\"));
  -     assertEquals("\\foo\\bar\\foo\\", FileAppender.stripDuplicateBackslashes("\\foo\\bar\\foo\\"));
  +     assertEquals("\\foo\\bar\\foo", OptionConverter.stripDuplicateBackslashes("\\foo\\bar\\foo"));
  +     assertEquals("\\foo\\bar\\foo\\", OptionConverter.stripDuplicateBackslashes("\\\\foo\\\\bar\\\\foo\\\\"));
  +     assertEquals("\\foo\\bar\\foo\\", OptionConverter.stripDuplicateBackslashes("\\foo\\bar\\foo\\"));
        //
        //   UNC's should either start with two backslashes and contain additional singles
        //       or four back slashes and addition doubles
  -     assertEquals("\\\\foo\\bar\\foo", FileAppender.stripDuplicateBackslashes("\\\\\\\\foo\\\\bar\\\\foo"));
  -     assertEquals("\\\\foo\\bar\\foo", FileAppender.stripDuplicateBackslashes("\\\\foo\\bar\\foo"));
  +     assertEquals("\\\\foo\\bar\\foo", OptionConverter.stripDuplicateBackslashes("\\\\\\\\foo\\\\bar\\\\foo"));
  +     assertEquals("\\\\foo\\bar\\foo", OptionConverter.stripDuplicateBackslashes("\\\\foo\\bar\\foo"));
   	 //
   	 //   it it starts with doubles but has no other path component
   	 //      then it is a file path
  -     assertEquals("\\foo.log", FileAppender.stripDuplicateBackslashes("\\\\foo.log"));
  +     assertEquals("\\foo.log", OptionConverter.stripDuplicateBackslashes("\\\\foo.log"));
   	 //
   	 //   it it starts with quads but has no other path component
   	 //      then it is a UNC
  -     assertEquals("\\\\foo.log", FileAppender.stripDuplicateBackslashes("\\\\\\\\foo.log"));
  +     assertEquals("\\\\foo.log", OptionConverter.stripDuplicateBackslashes("\\\\\\\\foo.log"));
     }  
     
     
  
  
  
  1.3       +3 -4      logging-log4j/tests/src/java/org/apache/log4j/watchdog/FileWatchdogTestCase.java
  
  Index: FileWatchdogTestCase.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/tests/src/java/org/apache/log4j/watchdog/FileWatchdogTestCase.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FileWatchdogTestCase.java	31 Jan 2005 03:48:07 -0000	1.2
  +++ FileWatchdogTestCase.java	18 Feb 2005 17:23:45 -0000	1.3
  @@ -29,9 +29,8 @@
   import org.apache.log4j.Logger;
   import org.apache.log4j.PropertyConfigurator;
   import org.apache.log4j.spi.Configurator;
  -import org.apache.log4j.xml.DOMConfigurator;
   import org.apache.log4j.joran.JoranConfigurator;
  -import org.apache.log4j.util.Compare;
  +
   
   public class FileWatchdogTestCase extends TestCase {
   
  @@ -154,7 +153,7 @@
         copyFile(sourceFile2, configFile);
         
         // wait a few seconds for the watchdog to react
  -      Thread.currentThread().sleep(4000);
  +      Thread.sleep(4000);
         
         // output some test messages
         logger.debug("debug message");
  @@ -209,7 +208,7 @@
         copyFile(sourceFile2, configFile);
         
         // wait a few seconds for the watchdog to react
  -      Thread.currentThread().sleep(4000);
  +      Thread.sleep(4000);
         
         // output some test messages
         logger.debug("debug message");
  
  
  
  1.27      +4 -3      logging-log4j/src/java/org/apache/log4j/chainsaw/ChainsawAppenderHandler.java
  
  Index: ChainsawAppenderHandler.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/chainsaw/ChainsawAppenderHandler.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- ChainsawAppenderHandler.java	5 Dec 2004 10:17:36 -0000	1.26
  +++ ChainsawAppenderHandler.java	18 Feb 2005 17:23:45 -0000	1.27
  @@ -57,11 +57,11 @@
   
     public ChainsawAppenderHandler(ChainsawAppender appender) {
       appender.setAppender(this);
  -    activateOptions();
  +    activate();
     }
   
     public ChainsawAppenderHandler() {
  -    activateOptions();
  +    activate();
     }
   
     public void setIdentifierExpression(String identifierExpression) {
  @@ -95,8 +95,9 @@
   
     public void close() {}
   
  -  public void activateOptions() {
  +  public void activate() {
       worker = new WorkQueue();
  +    super.activate();
     }
   
     public boolean requiresLayout() {
  
  
  
  1.13      +1 -1      logging-log4j/src/java/org/apache/log4j/chainsaw/ChainsawAppender.java
  
  Index: ChainsawAppender.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/chainsaw/ChainsawAppender.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- ChainsawAppender.java	8 Jan 2005 14:05:29 -0000	1.12
  +++ ChainsawAppender.java	18 Feb 2005 17:23:45 -0000	1.13
  @@ -109,7 +109,7 @@
      * Instantiates and activates an instance of a ChainsawViewer
      * to view the contents of this appender.
      */
  -  public void activateOptions() {
  +  public void activate() {
       if (viewerClassname == null) {
         viewerClassname = "org.apache.log4j.chainsaw.DefaultViewer";
       }
  
  
  
  1.98      +23 -4     logging-log4j/tests/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/logging-log4j/tests/build.xml,v
  retrieving revision 1.97
  retrieving revision 1.98
  diff -u -r1.97 -r1.98
  --- build.xml	12 Feb 2005 03:10:28 -0000	1.97
  +++ build.xml	18 Feb 2005 17:23:45 -0000	1.98
  @@ -191,7 +191,6 @@
                                        NDC,
                                        Plugins,
                                        CachedDateFormat,
  -                                     ReaderWriterLock,
     	                                 Schema
                                        "/>
   
  @@ -200,9 +199,29 @@
     <!-- ================================================================= -->
     <!-- Longer unit tests                                                 -->
     <!-- ================================================================= -->
  -  <target name="longUnit" depends=""/>
  +  <target name="longUnit" depends="ReaderWriterLock"/>
   
     <!-- ================================================================= -->
  +  <!-- Longer unit tests                                                 -->
  +  <!-- ================================================================= -->
  +  <target name="noArgTests" >
  +    <junit printsummary="yes" fork="yes" haltonfailure="yes">
  +  	  <classpath refid="tests.classpath"/>
  +  	  <formatter type="plain" usefile="false"/>
  +  	  <batchtest>
  +  	    <fileset dir="${tests.source.home}">
  +  	      <include name="**/*Test*.java"/>
  +  	      <exclude name="${stem}/DeadlockTest.java"/>
  +  	      <exclude name="${stem}/helpers/ReaderWriterLockTestCase.java"/>
  +  	      <exclude name="${stem}/defaultInit/*.java"/>
  +  	      <exclude name="${stem}/chainsaw/receivers/ReceiversHelperTest.java"/>
  +  	      <exclude name="${stem}/db/*.java"/>
  +  	    </fileset>
  +  	  </batchtest>
  +    </junit>
  +  </target>
  +	
  +  <!-- ================================================================= -->
     <!-- Rolling unit tests                                                 -->
     <!-- ================================================================= -->
   
  @@ -243,7 +262,7 @@
       <junit printsummary="yes" fork="yes" haltonfailure="yes">
         <classpath refid="tests.classpath"/>
         <formatter type="plain" usefile="false"/>
  -      <test name="org.apache.log4j.LoggerTestCase" />
  +      <test name="org.apache.log4j.LoggerTest" />
       </junit>
     </target>
     
  @@ -269,7 +288,7 @@
         <jvmarg value="-Dlog4j.debug=TRUE"/>
         <classpath refid="tests.classpath"/>
         <formatter type="plain" usefile="false"/>
  -      <test name="org.apache.log4j.xml.DOMTestCase" />
  +      <test name="org.apache.log4j.xml.DOMTest" />
       </junit>
     </target>
   
  
  
  
  1.55      +38 -0     logging-log4j/src/java/org/apache/log4j/helpers/OptionConverter.java
  
  Index: OptionConverter.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/helpers/OptionConverter.java,v
  retrieving revision 1.54
  retrieving revision 1.55
  diff -u -r1.54 -r1.55
  --- OptionConverter.java	11 Feb 2005 23:33:50 -0000	1.54
  +++ OptionConverter.java	18 Feb 2005 17:23:45 -0000	1.55
  @@ -487,6 +487,44 @@
     }
     
     /**
  +   * Replaces double backslashes (except the leading doubles in UNC's)
  +   * with single backslashes for compatibility with existing path specifications
  +   * that were working around use of OptionConverter.convertSpecialChars
  +   * in XML configuration files.
  +   * 
  +   * @param src source string
  +   * @return source string with double backslashes replaced
  +   * 
  +   * @since 1.3
  +   */
  +  public static String stripDuplicateBackslashes(final String src) {
  +    int i = src.lastIndexOf('\\');
  +    if (i > 0) {
  +      StringBuffer buf = new StringBuffer(src);
  +      for(; i > 0; i = src.lastIndexOf('\\', i - 1)) {
  +        //
  +        //  if the preceding character is a slash then
  +        //     remove the preceding character
  +        //     and continue processing with the earlier part of the string
  +        if(src.charAt(i - 1) == '\\') {
  +          buf.deleteCharAt(i);
  +          i--;
  +          if (i == 0) break;
  +        } else {
  +          //
  +          //  if there was a single slash then
  +          //    the string was not trying to work around
  +          //    convertSpecialChars
  +          //
  +          return src;
  +        }
  +      }
  +      return buf.toString();
  +    }
  +    return src;
  +  }
  +  
  +  /**
        Configure log4j given a URL.
   
        <p>The url must point to a file or resource which will be interpreted by
  
  
  
  1.3       +0 -1      logging-log4j/src/java/org/apache/log4j/joran/action/ParamAction.java
  
  Index: ParamAction.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/joran/action/ParamAction.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ParamAction.java	11 Feb 2005 18:11:44 -0000	1.2
  +++ ParamAction.java	18 Feb 2005 17:23:45 -0000	1.3
  @@ -18,7 +18,6 @@
   
   
   import org.apache.log4j.config.PropertySetter;
  -import org.apache.log4j.helpers.OptionConverter;
   import org.apache.log4j.joran.spi.ExecutionContext;
   import org.apache.log4j.spi.ErrorItem;
   
  
  
  

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


Re: activateOptions pattern not desirable

Posted by Curt Arnold <ca...@apache.org>.
On Feb 18, 2005, at 1:30 PM, Ceki Gülcü wrote:

>
> I don't think Appenders can be completely immutable. For one, you can 
> invoke the close() method on an appender. You can also add remove 
> filters or change the threshold of an active appender. The only 
> appender which should be immutable is a closed appender.
>
> It does not make much sense to me to harden appenders when one can 
> easily yank out any appender from a logger and replace it with a 
> different one...
>
>

I was suggesting that if a substantial part of the framework is being 
refactored, trying to make the objects immutable should be considered 
as part of the refactoring.  Maybe Appenders aren't a good fit with the 
pattern, maybe they are but it just isn't obvious.  I wasn't suggesting 
that we try to refactor them now.

However, the state changes that you mentioned could be represented by a 
series of immutable objects.  The advantage is that you would not need 
to synchronize the state changes only the swap of the new appender with 
the old appender.  For example, if I'm removing one filter and adding 
another filter and I'm changing the object in place, the appender with 
just the first filter removed could be visible to other threads for a 
period of time.  With immutable objects, I could do the state changes 
in isolation and then swap out the new appender for the old one as an 
atomic operation.  It also can reduce the number of code points that 
you have to worry about synchronization.  With immutable objects, you 
only have to synchronize the replacement of one object with another.  
With mutable objects, you have to synchronize every method that might 
be affected by the contents of a mutable field.


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


Re: activateOptions pattern not desirable

Posted by Ceki Gülcü <ce...@qos.ch>.
I don't think Appenders can be completely immutable. For one, you can 
invoke the close() method on an appender. You can also add remove filters 
or change the threshold of an active appender. The only appender which 
should be immutable is a closed appender.

It does not make much sense to me to harden appenders when one can easily 
yank out any appender from a logger and replace it with a different one...

At 07:03 PM 2/18/2005, Curt Arnold wrote:
>I obviously haven't reviewed your last commit, but you did appear to tweak 
>with activateOptions in a few classes and mention appender lifecycle which 
>brought the topic to mind.
>
>A very common pattern in log4j is to have a class that operates in a 
>configuration mode early in its lifetime and then after a call to activate 
>or activateOptions is ready for use.  Unfortunately this pattern implies 
>objects that are not inherently immutable.  See "Effective Java", item 13 
>for the benefits of immutable classes.  Since the objects using the 
>activateOptions pattern are subject to change early in the object's 
>lifetime, it is only developer etiquette and self-preservation that 
>enforces the object does not change during use.
>It would be better (in a perfect world) if distinct objects were used for 
>the mutable configuration and immutable run-time behavior.
>
>I don't have a path forward to move to greater use of immutable objects in 
>log4j.  However, I think it should be seriously considered on any 
>substantial rework.  When I finally get to my long standing date with 
>LoggingEvent, it is likely to come out immutable.
>
>When looking at appenders that change state over time, such as a database 
>appender that can go into a failsafe mode if it can't connect, it would be 
>preferable that these modes be represented by distinct immutable 
>objects.  So you would have an object that forever represented a working 
>database and an object that forever represented the failover mode and the 
>failover transition was accomplished by switching these objects out 
>instead of changing an object that has potentially been shared.
>
>One pattern that might allow a transition is to have activateOptions-like 
>methods return an object pointer which is used from then on.  Mutable 
>objects could just return "this" since they don't change object identity 
>when activating.  However, if one wanted to have an immutable 
>implementation, the initial instance could be of a "Configurator" or 
>"Builder" variant and the value returned from activateOptions would be 
>immutable.  For example, an immutable FileAppender could be implemented 
>with two classes: an immutable FileAppender and a FileAppenderBuilder, 
>which allows setFile and the like, and would return a FileAppender on the 
>call to activateOptions.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
>For additional commands, e-mail: log4j-dev-help@logging.apache.org

-- 
Ceki Gülcü

   The complete log4j manual: http://www.qos.ch/log4j/



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


activateOptions pattern not desirable

Posted by Curt Arnold <ca...@apache.org>.
I obviously haven't reviewed your last commit, but you did appear to 
tweak with activateOptions in a few classes and mention appender 
lifecycle which brought the topic to mind.

A very common pattern in log4j is to have a class that operates in a 
configuration mode early in its lifetime and then after a call to 
activate or activateOptions is ready for use.  Unfortunately this 
pattern implies objects that are not inherently immutable.  See 
"Effective Java", item 13 for the benefits of immutable classes.  Since 
the objects using the activateOptions pattern are subject to change 
early in the object's lifetime, it is only developer etiquette and 
self-preservation that enforces the object does not change during use.  
It would be better (in a perfect world) if distinct objects were used 
for the mutable configuration and immutable run-time behavior.

I don't have a path forward to move to greater use of immutable objects 
in log4j.  However, I think it should be seriously considered on any 
substantial rework.  When I finally get to my long standing date with 
LoggingEvent, it is likely to come out immutable.

When looking at appenders that change state over time, such as a 
database appender that can go into a failsafe mode if it can't connect, 
it would be preferable that these modes be represented by distinct 
immutable objects.  So you would have an object that forever 
represented a working database and an object that forever represented 
the failover mode and the failover transition was accomplished by 
switching these objects out instead of changing an object that has 
potentially been shared.

One pattern that might allow a transition is to have 
activateOptions-like methods return an object pointer which is used 
from then on.  Mutable objects could just return "this" since they 
don't change object identity when activating.  However, if one wanted 
to have an immutable implementation, the initial instance could be of a 
"Configurator" or "Builder" variant and the value returned from 
activateOptions would be immutable.  For example, an immutable 
FileAppender could be implemented with two classes: an immutable 
FileAppender and a FileAppenderBuilder, which allows setFile and the 
like, and would return a FileAppender on the call to activateOptions.


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


Re: cvs commit: logging-log4j/src/java/org/apache/log4j/joran/action ParamAction.java

Posted by Ceki Gülcü <ce...@qos.ch>.
I forgot to mention that with this commit, I may have unintentionally 
broken existing appenders. However, all currently available test cases 
execute without problems.

At 06:23 PM 2/18/2005, ceki@apache.org wrote:
>ceki        2005/02/18 09:23:45
>
>   Modified:    tests/src/java/org/apache/log4j/html Loop.java
>                tests/src/java/org/apache/log4j/rolling
>                         FilterBasedRollingTest.java RenamingTest.java
>                         TimeBasedRollingTest.java SizeBasedRollingTest.java
>                src/java/org/apache/log4j/varia ListModelAppender.java
>                         NullAppender.java
>                tests/src/java/org/apache/log4j/multiplex
>                         MultiplexAppenderTest.java
>                tests/src/java/org/apache/log4j/performance Loop.java
>                         NullAppender.java
>                src/java/org/apache/log4j/multiplex MultiplexAppender.java
>                         AppenderFactoryUtils.java
>                src/java/org/apache/log4j/watchdog FileWatchdog.java
>                         WatchdogSkeleton.java TimedURLWatchdog.java
>                src/java/org/apache/log4j/net MulticastAppender.java
>                         JMSAppender.java SMTPAppender.java
>                         SyslogAppender.java TelnetAppender.java
>                         SocketAppender.java UDPAppender.java
>                src/java/org/apache/log4j/rolling RollingFileAppender.java
>                src/java/org/apache/log4j WriterAppender.java
>                         AsyncAppender.java ConsoleAppender.java
>                         Appender.java FileAppender.java
>                         AppenderSkeleton.java LogManager.java
>                tests/src/java/org/apache/log4j VectorAppender.java
>                         AsyncAppenderTestCase.java
>                src/java/org/apache/log4j/config ConfiguratorBase.java
>                src/java/org/apache/log4j/db DBAppender.java
>                src/java/org/apache/log4j/spi ComponentBase.java
>                tests/witness/xml dom.A1.2 dom.A2.1 dom.A2.2 dom.A1.1
>                src/java/org/apache/log4j/joran JoranConfigurator.java
>                tests/src/java/org/apache/log4j/helpers
>                         OptionSubstitutionTest.java
>                tests/src/java/org/apache/log4j/watchdog
>                         FileWatchdogTestCase.java
>                src/java/org/apache/log4j/chainsaw
>                         ChainsawAppenderHandler.java ChainsawAppender.java
>                tests    build.xml
>                src/java/org/apache/log4j/helpers OptionConverter.java
>                src/java/org/apache/log4j/joran/action ParamAction.java
>   Added:       tests/input/xml DOMTest2.xml DOMTest1.xml
>                tests/src/java/org/apache/log4j LoggerTest.java
>                tests/src/java/org/apache/log4j/xml DOMTest.java
>   Removed:     tests/input/xml DOMTestCase1.xml DOMTestCase2.xml
>                tests/src/java/org/apache/log4j LoggerTestCase.java
>                tests/src/java/org/apache/log4j/xml DOMTestCase.java
>   Log:
>   - Added the isClosed(), activate(), isActive() methods to the Appender 
> interface.
>
>   Ther idea is to avoid using appenders which are not in working order. 
> Moreover, in future version, we would like to introduce
>   the capability for appenders suffering from temporary error conditions 
> to have a recovery lifecycle.
>
>   - Added getNonFloodingLogger method to ComponentBase. This method 
> returns a NOPLogger if called too frequently.
>
>   - Other minor changes.

-- 
Ceki Gülcü

   The complete log4j manual: http://www.qos.ch/log4j/



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