logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgo...@apache.org
Subject svn commit: r1196485 - in /logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers: log4j12-api/src/test/java/org/apache/log4j/ log4j2-api/src/main/java/org/apache/logging/log4j/ log4j2-core/ log4j2-core/src/main/java/org/apache/logging/log4j/core/config...
Date Wed, 02 Nov 2011 07:45:33 GMT
Author: rgoers
Date: Wed Nov  2 07:45:32 2011
New Revision: 1196485

URL: http://svn.apache.org/viewvc?rev=1196485&view=rev
Log:
Fix problems found by prepackaging plugins

Modified:
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j12-api/src/test/java/org/apache/log4j/CategoryTest.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j12-api/src/test/java/org/apache/log4j/LoggerTest.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/MarkerManager.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/pom.xml
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/config/plugins/PluginManager.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/ClassNamePatternConverter.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/NDCPatternConverter.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/PatternParser.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-jcl/src/test/java/org/apache/logging/log4j/jcl/LoggerTest.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-jcl/src/test/resources/log4j-test1.xml
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/slf4j-impl/src/test/java/org/apache/logging/slf4j/LoggerTest.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/slf4j-impl/src/test/resources/log4j-test1.xml

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j12-api/src/test/java/org/apache/log4j/CategoryTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j12-api/src/test/java/org/apache/log4j/CategoryTest.java?rev=1196485&r1=1196484&r2=1196485&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j12-api/src/test/java/org/apache/log4j/CategoryTest.java
(original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j12-api/src/test/java/org/apache/log4j/CategoryTest.java
Wed Nov  2 07:45:32 2011
@@ -19,7 +19,9 @@ package org.apache.log4j;
 
 import org.apache.logging.log4j.core.Layout;
 import org.apache.logging.log4j.core.LoggerContext;
-import org.apache.logging.log4j.core.appender.ListAppender;
+import org.apache.logging.log4j.status.StatusConsoleListener;
+import org.apache.logging.log4j.status.StatusLogger;
+import org.apache.logging.log4j.test.appender.ListAppender;
 import org.apache.logging.log4j.core.config.ConfigurationFactory;
 import org.apache.logging.log4j.core.layout.PatternLayout;
 import org.junit.AfterClass;
@@ -27,9 +29,6 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 
 
-import org.junit.Before;
-import org.junit.Assert;
-
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertFalse;
@@ -154,7 +153,7 @@ public class CategoryTest {
         String msg = msgs.get(0);
         appender.clear();
         String expected = "ERROR o.a.l.CategoryTest [main] Test Message\n";
-        assertTrue("Incorrect message.", msg.endsWith(expected));
+        assertTrue("Incorrect message \"" + msg + "\"" + " expected \"" + expected +"\"",
msg.endsWith(expected));
     }
 
     /**

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j12-api/src/test/java/org/apache/log4j/LoggerTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j12-api/src/test/java/org/apache/log4j/LoggerTest.java?rev=1196485&r1=1196484&r2=1196485&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j12-api/src/test/java/org/apache/log4j/LoggerTest.java
(original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j12-api/src/test/java/org/apache/log4j/LoggerTest.java
Wed Nov  2 07:45:32 2011
@@ -26,7 +26,7 @@ import java.util.ResourceBundle;
 import org.apache.logging.log4j.core.LogEvent;
 import org.apache.logging.log4j.core.LoggerContext;
 import org.apache.logging.log4j.core.appender.AppenderBase;
-import org.apache.logging.log4j.core.appender.ListAppender;
+import org.apache.logging.log4j.test.appender.ListAppender;
 import org.apache.logging.log4j.core.config.ConfigurationFactory;
 import org.junit.After;
 import org.junit.AfterClass;
@@ -34,9 +34,6 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 
 
-import org.junit.Before;
-import org.junit.Assert;
-
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/MarkerManager.java
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/MarkerManager.java?rev=1196485&r1=1196484&r2=1196485&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/MarkerManager.java
(original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/MarkerManager.java
Wed Nov  2 07:45:32 2011
@@ -74,11 +74,12 @@ public final class MarkerManager {
 
         private static final long serialVersionUID = 100L;
 
-        private String name;
-        private Marker parent;
+        private final String name;
+        private final Marker parent;
 
         public Log4JMarker(String name) {
             this.name = name;
+            this.parent = null;
         }
 
         public Log4JMarker(String name, Marker parent) {

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/pom.xml
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/pom.xml?rev=1196485&r1=1196484&r2=1196485&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/pom.xml (original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/pom.xml Wed Nov  2 07:45:32
2011
@@ -140,7 +140,7 @@
         <configuration>
           <mainClass>org.apache.logging.log4j.core.config.plugins.PluginManager</mainClass>
           <arguments>
-            <argument>Core,Lookup,ConfigurationFactory,Converter,FileConverter</argument>
+            <argument>${project.build.outputDirectory}</argument>
           </arguments>
         </configuration>
       </plugin>

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/config/plugins/PluginManager.java
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/config/plugins/PluginManager.java?rev=1196485&r1=1196484&r2=1196485&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/config/plugins/PluginManager.java
(original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/config/plugins/PluginManager.java
Wed Nov  2 07:45:32 2011
@@ -27,9 +27,7 @@ import java.io.DataOutputStream;
 import java.io.FileOutputStream;
 import java.io.InputStream;
 import java.text.DecimalFormat;
-import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
@@ -56,22 +54,14 @@ public class PluginManager {
 
     private final String type;
     private final Class clazz;
+    private static String rootDir;
 
     public static void main(String[] args) throws Exception {
-        if (args == null || args.length == 0) {
-            System.err.println("At least 1 type must be specified.");
+        if (args == null || args.length < 1) {
+            System.err.println("A target directory must be specified");
             System.exit(-1);
         }
-        List<String> list = new ArrayList<String>();
-        for (String arg : args) {
-            String[] types = arg.trim().split(",");
-            for (String type : types) {
-                if (type.trim().length() == 0) {
-                    continue;
-                }
-                list.add(type);
-            }
-        }
+        rootDir = args[0].endsWith("/") || args[0].endsWith("\\") ? args[0] : args[0] + "/";
 
         PluginManager manager = new PluginManager("Core");
         manager.collectPlugins(false);
@@ -194,7 +184,7 @@ public class PluginManager {
     }
 
     private static void encode(ConcurrentMap<String, ConcurrentMap<String, PluginType>>
map) {
-        String fileName = "target/classes/" + PATH + FILENAME;
+        String fileName = rootDir + PATH + FILENAME;
         try {
             FileOutputStream fos = new FileOutputStream(fileName);
             BufferedOutputStream bos = new BufferedOutputStream(fos);

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/ClassNamePatternConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/ClassNamePatternConverter.java?rev=1196485&r1=1196484&r2=1196485&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/ClassNamePatternConverter.java
(original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/ClassNamePatternConverter.java
Wed Nov  2 07:45:32 2011
@@ -45,8 +45,7 @@ public final class ClassNamePatternConve
      * @param options options, may be null.
      * @return instance of pattern converter.
      */
-    public static ClassNamePatternConverter newInstance(
-        final String[] options) {
+    public static ClassNamePatternConverter newInstance(final String[] options) {
         return new ClassNamePatternConverter(options);
     }
 

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/NDCPatternConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/NDCPatternConverter.java?rev=1196485&r1=1196484&r2=1196485&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/NDCPatternConverter.java
(original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/NDCPatternConverter.java
Wed Nov  2 07:45:32 2011
@@ -25,7 +25,7 @@ import org.apache.logging.log4j.core.con
  * Return the event's NDC in a StringBuffer.
  */
 @Plugin(name="NDCPatternConverter", type="Converter")
-@ConverterKeys({"C", "class"})
+@ConverterKeys({"x", "NDC"})
 public final class NDCPatternConverter extends LogEventPatternConverter {
   /**
    *   Singleton.

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/PatternParser.java
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/PatternParser.java?rev=1196485&r1=1196484&r2=1196485&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/PatternParser.java
(original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/PatternParser.java
Wed Nov  2 07:45:32 2011
@@ -106,7 +106,7 @@ public final class PatternParser {
                     }
                 }
             } catch (Exception ex) {
-
+                logger.error("Error processing plugin " + type.getElementName(), ex);
             }
         }
         converterRules = converters;

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-jcl/src/test/java/org/apache/logging/log4j/jcl/LoggerTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-jcl/src/test/java/org/apache/logging/log4j/jcl/LoggerTest.java?rev=1196485&r1=1196484&r2=1196485&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-jcl/src/test/java/org/apache/logging/log4j/jcl/LoggerTest.java
(original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-jcl/src/test/java/org/apache/logging/log4j/jcl/LoggerTest.java
Wed Nov  2 07:45:32 2011
@@ -21,7 +21,7 @@ import org.apache.commons.logging.LogFac
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.core.Appender;
 import org.apache.logging.log4j.core.LoggerContext;
-import org.apache.logging.log4j.core.appender.ListAppender;
+import org.apache.logging.log4j.test.appender.ListAppender;
 import org.apache.logging.log4j.core.config.Configuration;
 import org.apache.logging.log4j.core.config.XMLConfigurationFactory;
 import org.apache.logging.log4j.status.StatusLogger;

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-jcl/src/test/resources/log4j-test1.xml
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-jcl/src/test/resources/log4j-test1.xml?rev=1196485&r1=1196484&r2=1196485&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-jcl/src/test/resources/log4j-test1.xml
(original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-jcl/src/test/resources/log4j-test1.xml
Wed Nov  2 07:45:32 2011
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<configuration packages="" status="debug" name="LoggerTest">
+<configuration packages="org.apache.logging.log4j.test" status="debug" name="LoggerTest">
   <properties>
     <property name="filename">target/test.log</property>
   </properties>

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/slf4j-impl/src/test/java/org/apache/logging/slf4j/LoggerTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/slf4j-impl/src/test/java/org/apache/logging/slf4j/LoggerTest.java?rev=1196485&r1=1196484&r2=1196485&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/slf4j-impl/src/test/java/org/apache/logging/slf4j/LoggerTest.java
(original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/slf4j-impl/src/test/java/org/apache/logging/slf4j/LoggerTest.java
Wed Nov  2 07:45:32 2011
@@ -19,7 +19,7 @@ package org.apache.logging.slf4j;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.core.Appender;
 import org.apache.logging.log4j.core.LoggerContext;
-import org.apache.logging.log4j.core.appender.ListAppender;
+import org.apache.logging.log4j.test.appender.ListAppender;
 import org.apache.logging.log4j.core.config.Configuration;
 import org.apache.logging.log4j.core.config.XMLConfigurationFactory;
 import org.apache.logging.log4j.status.StatusLogger;

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/slf4j-impl/src/test/resources/log4j-test1.xml
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/slf4j-impl/src/test/resources/log4j-test1.xml?rev=1196485&r1=1196484&r2=1196485&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/slf4j-impl/src/test/resources/log4j-test1.xml
(original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/slf4j-impl/src/test/resources/log4j-test1.xml
Wed Nov  2 07:45:32 2011
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<configuration packages="" status="debug" name="LoggerTest">
+<configuration packages="org.apache.logging.log4j.test" status="debug" name="LoggerTest">
   <properties>
     <property name="filename">target/test.log</property>
   </properties>



Mime
View raw message