logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From carn...@apache.org
Subject svn commit: r532827 - in /logging/sandbox/log4j/rolling: ./ src/main/java/org/apache/log4j/rolling/ src/main/java/org/apache/log4j/xml/ src/main/resources/org/ src/main/resources/org/apache/ src/main/resources/org/apache/log4j/ src/main/resources/org/a...
Date Thu, 26 Apr 2007 18:05:36 GMT
Author: carnold
Date: Thu Apr 26 11:05:34 2007
New Revision: 532827

URL: http://svn.apache.org/viewvc?view=rev&rev=532827
Log:
Bug 42251: PluginConfigurator rework, change test working directory

Added:
    logging/sandbox/log4j/rolling/src/main/java/org/apache/log4j/rolling/RollingConfigurator.java
      - copied, changed from r532798, logging/sandbox/log4j/component/src/main/java/org/apache/log4j/plugins/PluginConfigurator.java
    logging/sandbox/log4j/rolling/src/main/java/org/apache/log4j/xml/UnrecognizedElementHandler.java
      - copied unchanged from r532798, logging/log4j/branches/v1_2-branch/src/java/org/apache/log4j/xml/UnrecognizedElementHandler.java
    logging/sandbox/log4j/rolling/src/main/resources/org/
    logging/sandbox/log4j/rolling/src/main/resources/org/apache/
    logging/sandbox/log4j/rolling/src/main/resources/org/apache/log4j/
    logging/sandbox/log4j/rolling/src/main/resources/org/apache/log4j/rolling/
    logging/sandbox/log4j/rolling/src/main/resources/org/apache/log4j/rolling/log4j.dtd
      - copied, changed from r532798, logging/sandbox/log4j/component/src/main/resources/org/apache/log4j/plugins/log4j.dtd
Removed:
    logging/sandbox/log4j/rolling/src/main/java/org/apache/log4j/xml/RollingConfigurator.java
    logging/sandbox/log4j/rolling/src/main/java/org/apache/log4j/xml/UnrecognizedElementParser.java
Modified:
    logging/sandbox/log4j/rolling/build.xml
    logging/sandbox/log4j/rolling/pom.xml
    logging/sandbox/log4j/rolling/src/main/java/org/apache/log4j/rolling/FilterBasedTriggeringPolicy.java
    logging/sandbox/log4j/rolling/src/main/java/org/apache/log4j/rolling/RollingFileAppender.java
    logging/sandbox/log4j/rolling/src/test/java/org/apache/log4j/rolling/FilterBasedRollingTest.java
    logging/sandbox/log4j/rolling/src/test/java/org/apache/log4j/rolling/TimeBasedRollingTest.java
    logging/sandbox/log4j/rolling/src/test/resources/org/apache/log4j/rolling/filter1.xml

Modified: logging/sandbox/log4j/rolling/build.xml
URL: http://svn.apache.org/viewvc/logging/sandbox/log4j/rolling/build.xml?view=diff&rev=532827&r1=532826&r2=532827
==============================================================================
--- logging/sandbox/log4j/rolling/build.xml (original)
+++ logging/sandbox/log4j/rolling/build.xml Thu Apr 26 11:05:34 2007
@@ -47,9 +47,9 @@
     <property name="log4j.jar" 
        location="${m2_repo}/log4j/log4j/${log4j.version}/log4j-${log4j.version}.jar"/>
     <property name="pattern-layout.jar"
-       location="${m2_repo}/log4j/log4j/${pattern-layout.version}/apache-log4j-pattern-layout-${pattern-layout.version}.jar"/>
+       location="${m2_repo}/log4j/apache-log4j-pattern-layout/${pattern-layout.version}/apache-log4j-pattern-layout-${pattern-layout.version}.jar"/>
     <property name="filters.jar"
-       location="${m2_repo}/log4j/log4j/${filters.version}/apache-log4j-filters-${filters.version}.jar"/>
+       location="${m2_repo}/log4j/apache-log4j-filters/${filters.version}/apache-log4j-filters-${filters.version}.jar"/>
 
     <!--   Java compiler settings   -->
     <property name="javac.source" value="1.3"/>
@@ -81,7 +81,7 @@
     	   target="${javac.target}"
     	   source="${javac.source}"
     	   classpathref="compile-classpath"/>
-    	<copy todir="target/classes">
+    	<copy todir="target/classes" overwrite="true">
     	    <fileset dir="src/main/resources"/>
     	</copy>
     </target>
@@ -112,14 +112,14 @@
     	   target="${javac.target}"
     	   source="${javac.source}"
     	   classpathref="test-classpath"/>
-    	<copy todir="target/test-classes">
+    	<copy todir="target/test-classes" overwrite="true">
     		<fileset dir="src/test/resources"/>
     	</copy>
     </target>    
 
 
     <target name="test" depends="test-compile" description="Run unit tests">
-    	<junit printsummary="yes">
+    	<junit printsummary="yes" fork="true" dir="target">
             <classpath>
                 <path refid="test-classpath"/>
                 <pathelement path="target/test-classes"/>

Modified: logging/sandbox/log4j/rolling/pom.xml
URL: http://svn.apache.org/viewvc/logging/sandbox/log4j/rolling/pom.xml?view=diff&rev=532827&r1=532826&r2=532827
==============================================================================
--- logging/sandbox/log4j/rolling/pom.xml (original)
+++ logging/sandbox/log4j/rolling/pom.xml Thu Apr 26 11:05:34 2007
@@ -95,6 +95,13 @@
         </dependencies>
       </plugin>
       <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <workingDirectory>target</workingDirectory>
+        </configuration>
+      </plugin>	  
+      <plugin>
         <artifactId>maven-compiler-plugin</artifactId>
         <configuration>
             <source>1.3</source>

Modified: logging/sandbox/log4j/rolling/src/main/java/org/apache/log4j/rolling/FilterBasedTriggeringPolicy.java
URL: http://svn.apache.org/viewvc/logging/sandbox/log4j/rolling/src/main/java/org/apache/log4j/rolling/FilterBasedTriggeringPolicy.java?view=diff&rev=532827&r1=532826&r2=532827
==============================================================================
--- logging/sandbox/log4j/rolling/src/main/java/org/apache/log4j/rolling/FilterBasedTriggeringPolicy.java
(original)
+++ logging/sandbox/log4j/rolling/src/main/java/org/apache/log4j/rolling/FilterBasedTriggeringPolicy.java
Thu Apr 26 11:05:34 2007
@@ -20,7 +20,7 @@
 import org.apache.log4j.spi.Filter;
 import org.apache.log4j.spi.LoggingEvent;
 import org.apache.log4j.spi.OptionHandler;
-import org.apache.log4j.xml.*;
+import org.apache.log4j.xml.UnrecognizedElementHandler;
 import org.w3c.dom.Element;
 
 import java.util.Properties;
@@ -36,7 +36,7 @@
  *
  */
 public final class FilterBasedTriggeringPolicy
-        implements TriggeringPolicy, UnrecognizedElementParser {
+        implements TriggeringPolicy, UnrecognizedElementHandler {
   /**
    * The first filter in the filter chain. Set to <code>null</code> initially.
    */

Copied: logging/sandbox/log4j/rolling/src/main/java/org/apache/log4j/rolling/RollingConfigurator.java
(from r532798, logging/sandbox/log4j/component/src/main/java/org/apache/log4j/plugins/PluginConfigurator.java)
URL: http://svn.apache.org/viewvc/logging/sandbox/log4j/rolling/src/main/java/org/apache/log4j/rolling/RollingConfigurator.java?view=diff&rev=532827&p1=logging/sandbox/log4j/component/src/main/java/org/apache/log4j/plugins/PluginConfigurator.java&r1=532798&p2=logging/sandbox/log4j/rolling/src/main/java/org/apache/log4j/rolling/RollingConfigurator.java&r2=532827
==============================================================================
--- logging/sandbox/log4j/component/src/main/java/org/apache/log4j/plugins/PluginConfigurator.java
(original)
+++ logging/sandbox/log4j/rolling/src/main/java/org/apache/log4j/rolling/RollingConfigurator.java
Thu Apr 26 11:05:34 2007
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.log4j.plugins;
+package org.apache.log4j.rolling;
 
 import org.apache.log4j.Appender;
 import org.apache.log4j.Layout;
@@ -67,7 +67,7 @@
  * renamed for use with earlier versions of log4j.
  *
 */
-public class PluginConfigurator implements Configurator {
+public class RollingConfigurator implements Configurator {
 
   static final String CONFIGURATION_TAG = "log4j:configuration";
   static final String OLD_CONFIGURATION_TAG = "configuration";
@@ -116,7 +116,7 @@
      No argument constructor.
   */
   public
-  PluginConfigurator () {
+  RollingConfigurator () {
     appenderBag = new Hashtable();
   }
 
@@ -261,7 +261,7 @@
                 "] which does not implement org.apache.log4j.spi.AppenderAttachable.");
 	    }
 	  } else {
-          parseUnrecognizedElement(instance, appenderElement, props);
+          parseUnrecognizedElement(instance, currentElement, props);
       }
 	}
       }
@@ -890,7 +890,9 @@
 	  parseRoot(currentElement);
 	} else if(tagName.equals(RENDERER_TAG)) {
 	  parseRenderer(currentElement);
-	} else if (!tagName.equals(CATEGORY_FACTORY_TAG)) {
+	} else if (!(tagName.equals(APPENDER_TAG)
+            || tagName.equals(CATEGORY_FACTORY_TAG)
+            || tagName.equals(LOGGER_FACTORY_TAG))) {
         quietParseUnrecognizedElement(repository, currentElement, props);
     }
       }
@@ -996,7 +998,7 @@
          <code>filename</code> to reconfigure log4j. */
       public
       void doOnChange() {
-        new PluginConfigurator().doConfigure(filename,
+        new RollingConfigurator().doConfigure(filename,
                           LogManager.getLoggerRepository());
       }
     }
@@ -1014,7 +1016,7 @@
       public InputSource resolveEntity (String publicId, String systemId) {
         if (systemId.endsWith("log4j.dtd")) {
           Class clazz = getClass();
-          InputStream in = Log4jEntityResolver.class.getResourceAsStream("log4j.dtd");
+          InputStream in = clazz.getResourceAsStream("log4j.dtd");
           if (in == null) {
         LogLog.error("Could not find [log4j.dtd]. Used [" + clazz.getClassLoader()
                  + "] class loader in the search.");

Modified: logging/sandbox/log4j/rolling/src/main/java/org/apache/log4j/rolling/RollingFileAppender.java
URL: http://svn.apache.org/viewvc/logging/sandbox/log4j/rolling/src/main/java/org/apache/log4j/rolling/RollingFileAppender.java?view=diff&rev=532827&r1=532826&r2=532827
==============================================================================
--- logging/sandbox/log4j/rolling/src/main/java/org/apache/log4j/rolling/RollingFileAppender.java
(original)
+++ logging/sandbox/log4j/rolling/src/main/java/org/apache/log4j/rolling/RollingFileAppender.java
Thu Apr 26 11:05:34 2007
@@ -27,11 +27,10 @@
 import org.apache.log4j.spi.ErrorHandler;
 import org.apache.log4j.spi.LoggingEvent;
 import org.apache.log4j.spi.OptionHandler;
-import org.apache.log4j.xml.UnrecognizedElementParser;
+import org.apache.log4j.xml.UnrecognizedElementHandler;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
-import org.apache.log4j.xml.RollingConfigurator;
 
 import java.io.File;
 import java.io.FileOutputStream;
@@ -89,7 +88,7 @@
  * @since  1.3
  * */
 public final class RollingFileAppender extends FileAppender
-        implements UnrecognizedElementParser {
+        implements UnrecognizedElementHandler {
   /**
    * Triggering policy.
    */

Copied: logging/sandbox/log4j/rolling/src/main/resources/org/apache/log4j/rolling/log4j.dtd
(from r532798, logging/sandbox/log4j/component/src/main/resources/org/apache/log4j/plugins/log4j.dtd)
URL: http://svn.apache.org/viewvc/logging/sandbox/log4j/rolling/src/main/resources/org/apache/log4j/rolling/log4j.dtd?view=diff&rev=532827&p1=logging/sandbox/log4j/component/src/main/resources/org/apache/log4j/plugins/log4j.dtd&r1=532798&p2=logging/sandbox/log4j/rolling/src/main/resources/org/apache/log4j/rolling/log4j.dtd&r2=532827
==============================================================================
--- logging/sandbox/log4j/component/src/main/resources/org/apache/log4j/plugins/log4j.dtd
(original)
+++ logging/sandbox/log4j/rolling/src/main/resources/org/apache/log4j/rolling/log4j.dtd Thu
Apr 26 11:05:34 2007
@@ -136,14 +136,14 @@
 >
 
 <!ELEMENT triggeringPolicy ((param|filter)*)>
-<!ATTLIST plugin
-  name 		CDATA 	   #REQUIRED
+<!ATTLIST triggeringPolicy
+  name 		CDATA  #IMPLIED
   class 	CDATA  #REQUIRED
 >
 
 <!ELEMENT rollingPolicy (param*)>
-<!ATTLIST plugin
-  name 		CDATA 	   #REQUIRED
+<!ATTLIST rollingPolicy
+  name 		CDATA  #IMPLIED
   class 	CDATA  #REQUIRED
 >
 

Modified: logging/sandbox/log4j/rolling/src/test/java/org/apache/log4j/rolling/FilterBasedRollingTest.java
URL: http://svn.apache.org/viewvc/logging/sandbox/log4j/rolling/src/test/java/org/apache/log4j/rolling/FilterBasedRollingTest.java?view=diff&rev=532827&r1=532826&r2=532827
==============================================================================
--- logging/sandbox/log4j/rolling/src/test/java/org/apache/log4j/rolling/FilterBasedRollingTest.java
(original)
+++ logging/sandbox/log4j/rolling/src/test/java/org/apache/log4j/rolling/FilterBasedRollingTest.java
Thu Apr 26 11:05:34 2007
@@ -26,7 +26,7 @@
 import org.apache.log4j.PatternLayout;
 import org.apache.log4j.filter.LevelRangeFilter;
 import org.apache.log4j.util.Compare;
-import org.apache.log4j.xml.RollingConfigurator;
+import org.apache.log4j.rolling.RollingConfigurator;
 
 import java.io.FileNotFoundException;
 import java.io.IOException;

Modified: logging/sandbox/log4j/rolling/src/test/java/org/apache/log4j/rolling/TimeBasedRollingTest.java
URL: http://svn.apache.org/viewvc/logging/sandbox/log4j/rolling/src/test/java/org/apache/log4j/rolling/TimeBasedRollingTest.java?view=diff&rev=532827&r1=532826&r2=532827
==============================================================================
--- logging/sandbox/log4j/rolling/src/test/java/org/apache/log4j/rolling/TimeBasedRollingTest.java
(original)
+++ logging/sandbox/log4j/rolling/src/test/java/org/apache/log4j/rolling/TimeBasedRollingTest.java
Thu Apr 26 11:05:34 2007
@@ -23,7 +23,7 @@
 import org.apache.log4j.Logger;
 import org.apache.log4j.PatternLayout;
 import org.apache.log4j.util.Compare;
-import org.apache.log4j.xml.RollingConfigurator;
+import org.apache.log4j.rolling.RollingConfigurator;
 
 import java.io.FileNotFoundException;
 import java.io.IOException;

Modified: logging/sandbox/log4j/rolling/src/test/resources/org/apache/log4j/rolling/filter1.xml
URL: http://svn.apache.org/viewvc/logging/sandbox/log4j/rolling/src/test/resources/org/apache/log4j/rolling/filter1.xml?view=diff&rev=532827&r1=532826&r2=532827
==============================================================================
--- logging/sandbox/log4j/rolling/src/test/resources/org/apache/log4j/rolling/filter1.xml
(original)
+++ logging/sandbox/log4j/rolling/src/test/resources/org/apache/log4j/rolling/filter1.xml
Thu Apr 26 11:05:34 2007
@@ -1,9 +1,10 @@
 <?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE log4j:configuration>
+<!DOCTYPE log4j:configuration SYSTEM 'http://logging.apache.org/log4j/log4j.dtd'>
 
-<log4j:configuration xmlns:log4j='http://logging.apache.org/' debug="true">
+<log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/' debug="true">
 
   <appender name="ROLLING" class="org.apache.log4j.rolling.RollingFileAppender">
+    <param name="append" value="false"/>
     <rollingPolicy class="org.apache.log4j.rolling.FixedWindowRollingPolicy">
        <param name="activeFileName" value="output/filterBased-test1.log"/>
        <param name="fileNamePattern" value="output/filterBased-test1.%i"/>
@@ -17,7 +18,6 @@
     <layout class="org.apache.log4j.PatternLayout">
       <param name="ConversionPattern" value="%m%n"/>
     </layout>
-    <param name="append" value="false"/>
   </appender>
   
   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
@@ -27,8 +27,8 @@
   </appender>	    
 
   <logger name="org.apache.log4j.rolling.FilterBasedRollingTest" additivity="false">
-    <appender-ref ref="ROLLING"/>
     <level value="debug"/>
+    <appender-ref ref="ROLLING"/>
   </logger>
  
   <root>



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


Mime
View raw message