logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgo...@apache.org
Subject svn commit: r1103729 - in /logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src: main/java/org/apache/logging/log4j/core/appender/ main/java/org/apache/logging/log4j/core/appender/rolling/ main/java/org/apache/logging/log4j/core/config...
Date Mon, 16 May 2011 13:29:04 GMT
Author: rgoers
Date: Mon May 16 13:29:03 2011
New Revision: 1103729

URL: http://svn.apache.org/viewvc?rev=1103729&view=rev
Log:
More rolling appender tests working

Added:
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java
      - copied, changed from r1102953, logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/FixedWindowRolloverStrategy.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/AbstractPatternConverter.java
      - copied, changed from r1084027, logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/PatternConverter.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/ArrayPatternConverter.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/PatternConverter.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderTimeAndSizeTest.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderTimeTest.java
      - copied, changed from r1102953, logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderSizeTest.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/resources/log4j-rolling2.xml
      - copied, changed from r1102953, logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/resources/log4j-rolling1.xml
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/resources/log4j-rolling3.xml
Removed:
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/FixedWindowRolloverStrategy.java
Modified:
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/OutputStreamManager.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/RollingFileAppender.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/CompositeTriggeringPolicy.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/PatternProcessor.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/RollingFileManager.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/SizeBasedTriggeringPolicy.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/TimeBasedTriggeringPolicy.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/config/BaseConfiguration.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/DatePatternConverter.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/IntegerPatternConverter.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/LiteralPatternConverter.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/LogEventPatternConverter.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/resources/log4j-rolling1.xml

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/OutputStreamManager.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/appender/OutputStreamManager.java?rev=1103729&r1=1103728&r2=1103729&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/OutputStreamManager.java
(original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/OutputStreamManager.java
Mon May 16 13:29:03 2011
@@ -16,6 +16,7 @@
  */
 package org.apache.logging.log4j.core.appender;
 
+import com.sun.tools.hat.internal.model.StackTrace;
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.core.Lifecycle;
 import org.apache.logging.log4j.internal.StatusLogger;

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/RollingFileAppender.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/appender/RollingFileAppender.java?rev=1103729&r1=1103728&r2=1103729&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/RollingFileAppender.java
(original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/RollingFileAppender.java
Mon May 16 13:29:03 2011
@@ -18,6 +18,7 @@ package org.apache.logging.log4j.core.ap
 
 import org.apache.logging.log4j.core.Layout;
 import org.apache.logging.log4j.core.LogEvent;
+import org.apache.logging.log4j.core.appender.rolling.DefaultRolloverStrategy;
 import org.apache.logging.log4j.core.appender.rolling.RollingFileManager;
 import org.apache.logging.log4j.core.appender.rolling.RolloverStrategy;
 import org.apache.logging.log4j.core.appender.rolling.TriggeringPolicy;
@@ -104,8 +105,7 @@ public class RollingFileAppender extends
         }
 
         if (strategy == null) {
-            logger.error("A RolloverStrategy must be provided");
-            return null;
+            strategy = DefaultRolloverStrategy.createStrategy(null, null);
         }
 
         RollingFileManager manager = RollingFileManager.getFileManager(fileName, filePattern,
isAppend, isBuffered);

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/CompositeTriggeringPolicy.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/appender/rolling/CompositeTriggeringPolicy.java?rev=1103729&r1=1103728&r2=1103729&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/CompositeTriggeringPolicy.java
(original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/CompositeTriggeringPolicy.java
Mon May 16 13:29:03 2011
@@ -51,6 +51,20 @@ public class CompositeTriggeringPolicy i
         return false;
     }
 
+    public String toString() {
+        StringBuilder sb = new StringBuilder("CompositeTriggeringPolicy{");
+        boolean first = true;
+        for (TriggeringPolicy policy : policies) {
+            if (!first) {
+                sb.append(", ");
+            }
+            sb.append(policy.toString());
+            first = false;
+        }
+        sb.append("}");
+        return sb.toString();
+    }
+
     @PluginFactory
     public static CompositeTriggeringPolicy createPolicy(@PluginElement("policies") TriggeringPolicy[]
policies) {
         return new CompositeTriggeringPolicy(policies);

Copied: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java
(from r1102953, logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/FixedWindowRolloverStrategy.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/appender/rolling/DefaultRolloverStrategy.java?p2=logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java&p1=logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/FixedWindowRolloverStrategy.java&r1=1102953&r2=1103729&rev=1103729&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/FixedWindowRolloverStrategy.java
(original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java
Mon May 16 13:29:03 2011
@@ -59,8 +59,8 @@ import java.util.List;
  * current implementation will automatically reduce the window size to 12 when
  * larger values are specified by the user.
  */
-@Plugin(name = "FixedWindowRolloverStrategy", type = "Core", printObject = true)
-public class FixedWindowRolloverStrategy implements RolloverStrategy {
+@Plugin(name = "DefaultRolloverStrategy", type = "Core", printObject = true)
+public class DefaultRolloverStrategy implements RolloverStrategy {
     /**
      * It's almost always a bad idea to have a large window size, say over 12.
      */
@@ -85,7 +85,7 @@ public class FixedWindowRolloverStrategy
      * @param min The minimum index.
      * @param max The maximum index.
      */
-    public FixedWindowRolloverStrategy(int min, int max) {
+    public DefaultRolloverStrategy(int min, int max) {
         minIndex = min;
         maxIndex = max;
     }
@@ -216,8 +216,12 @@ public class FixedWindowRolloverStrategy
         return true;
     }
 
+    public String toString() {
+        return "DefaultRolloverStrategy(min=" + minIndex + ", max=" + maxIndex + ")";
+    }
+
     @PluginFactory
-    public static FixedWindowRolloverStrategy createStrategy(@PluginAttr("max") String max,
+    public static DefaultRolloverStrategy createStrategy(@PluginAttr("max") String max,
                                                              @PluginAttr("min") String min)
{
         int maxIndex;
         if (max != null) {
@@ -240,7 +244,7 @@ public class FixedWindowRolloverStrategy
             minIndex = MIN_WINDOW_SIZE;
         }
 
-        return new FixedWindowRolloverStrategy(minIndex, maxIndex);
+        return new DefaultRolloverStrategy(minIndex, maxIndex);
     }
 
 }

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/PatternProcessor.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/appender/rolling/PatternProcessor.java?rev=1103729&r1=1103728&r2=1103729&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/PatternProcessor.java
(original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/PatternProcessor.java
Mon May 16 13:29:03 2011
@@ -16,6 +16,7 @@
  */
 package org.apache.logging.log4j.core.appender.rolling;
 
+import org.apache.logging.log4j.core.pattern.ArrayPatternConverter;
 import org.apache.logging.log4j.core.pattern.DatePatternConverter;
 import org.apache.logging.log4j.core.pattern.FormattingInfo;
 import org.apache.logging.log4j.core.pattern.IntegerPatternConverter;
@@ -33,7 +34,7 @@ import java.util.List;
 public class PatternProcessor {
 
     private final String pattern;
-    private final PatternConverter[] patternConverters;
+    private final ArrayPatternConverter[] patternConverters;
     private final FormattingInfo[] patternFields;
 
     private DatePatternConverter dateConverter = null;
@@ -60,10 +61,10 @@ public class PatternProcessor {
         parser.parse(pattern, converters, fields);
         FormattingInfo[] infoArray = new FormattingInfo[fields.size()];
         patternFields = fields.toArray(infoArray);
-        PatternConverter[] converterArray = new PatternConverter[converters.size()];
+        ArrayPatternConverter[] converterArray = new ArrayPatternConverter[converters.size()];
         patternConverters = converters.toArray(converterArray);
 
-        for (PatternConverter converter : patternConverters) {
+        for (ArrayPatternConverter converter : patternConverters) {
             if (converter instanceof DatePatternConverter) {
                 dateConverter = (DatePatternConverter) converter;
                 frequency = calculateFrequency(dateConverter.getPattern());
@@ -82,7 +83,7 @@ public class PatternProcessor {
             throw new IllegalStateException("Pattern does not contain a date");
         }
         Calendar currentCal = Calendar.getInstance();
-        currentCal.setTime(new Date(current));
+        currentCal.setTimeInMillis(current);
         Calendar cal = Calendar.getInstance();
         cal.set(currentCal.get(Calendar.YEAR), 0, 1, 0, 0, 0);
         cal.set(Calendar.MILLISECOND, 0);
@@ -129,9 +130,20 @@ public class PatternProcessor {
      * @param buf string buffer to which formatted file name is appended, may not be null.
      */
     protected final void formatFileName(final Object obj, final StringBuilder buf) {
+        Object[] objects = new Object[] { new Date(System.currentTimeMillis()), obj};
+        formatFileName(objects, buf);
+    }
+
+    /**
+     * Format file name.
+     *
+     * @param objects objects to be evaluated in formatting, may not be null.
+     * @param buf string buffer to which formatted file name is appended, may not be null.
+     */
+    protected final void formatFileName(final Object[] objects, final StringBuilder buf)
{
         for (int i = 0; i < patternConverters.length; i++) {
             int fieldStart = buf.length();
-            patternConverters[i].format(obj, buf);
+            patternConverters[i].format(objects, buf);
 
             if (patternFields[i] != null) {
                 patternFields[i].format(fieldStart, buf);

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/RollingFileManager.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/appender/rolling/RollingFileManager.java?rev=1103729&r1=1103728&r2=1103729&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/RollingFileManager.java
(original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/RollingFileManager.java
Mon May 16 13:29:03 2011
@@ -30,6 +30,8 @@ import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.OutputStream;
+import java.text.SimpleDateFormat;
+import java.util.Date;
 import java.util.concurrent.ArrayBlockingQueue;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.locks.Lock;
@@ -103,19 +105,17 @@ public class RollingFileManager extends 
 
     private boolean rollover(RolloverStrategy strategy) {
 
-        boolean success = false;
-
         try {
             /* Block until the asynchronous operation is completed. If it takes too long
then
                don't roll over.
              */
-            if (queue.poll(50, TimeUnit.MILLISECONDS) == null) {
+            if (queue.poll(100, TimeUnit.MILLISECONDS) == null) {
                 logger.error("Unable to acquire lock for rollover");
-                return success;
+                return false;
             }
         } catch (InterruptedException ie) {
             logger.error("Thread interrupted while attempting to check rollover", ie);
-            return success;
+            return false;
         }
 
         RolloverDescription descriptor = strategy.rollover(this);
@@ -124,6 +124,7 @@ public class RollingFileManager extends 
 
             close();
 
+            boolean success = false;
             try {
 
                 if (descriptor.getSynchronous() != null) {
@@ -146,7 +147,7 @@ public class RollingFileManager extends 
                     queue.add(this);
                 }
             }
-            return success;
+            return true;
         }
         return false;
     }
@@ -212,12 +213,18 @@ public class RollingFileManager extends 
 
         public RollingFileManager createManager(FactoryData data) {
             File file = new File(data.fileName);
-            long size = data.append ? file.length() : 0;
-            long time = file.lastModified();
             final File parent = file.getParentFile();
             if (null != parent && !parent.exists()) {
                 parent.mkdirs();
             }
+            try {
+                file.createNewFile();
+            } catch (IOException ioe) {
+                logger.error("Unable to create file " + data.fileName, ioe);
+                return null;
+            }
+            long size = data.append ? file.length() : 0;
+            long time = file.lastModified();
 
             OutputStream os;
             try {

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/SizeBasedTriggeringPolicy.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/appender/rolling/SizeBasedTriggeringPolicy.java?rev=1103729&r1=1103728&r2=1103729&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/SizeBasedTriggeringPolicy.java
(original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/SizeBasedTriggeringPolicy.java
Mon May 16 13:29:03 2011
@@ -81,6 +81,10 @@ public class SizeBasedTriggeringPolicy i
         return manager.getFileSize() > maxFileSize;
     }
 
+    public String toString() {
+        return "SizeBasedTriggeringPolicy(size=" + maxFileSize +")";
+    }
+
     @PluginFactory
     public static SizeBasedTriggeringPolicy createPolicy(@PluginAttr("size") String size)
{
 

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/TimeBasedTriggeringPolicy.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/appender/rolling/TimeBasedTriggeringPolicy.java?rev=1103729&r1=1103728&r2=1103729&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/TimeBasedTriggeringPolicy.java
(original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/TimeBasedTriggeringPolicy.java
Mon May 16 13:29:03 2011
@@ -38,6 +38,9 @@ public class TimeBasedTriggeringPolicy i
     }
 
     public boolean isTriggeringEvent(LogEvent event) {
+        if (manager.getFileSize() == 0) {
+            return false;
+        }
         long now = System.currentTimeMillis();
         if (now > nextRollover) {
             nextRollover = manager.getProcessor().getNextTime(now);
@@ -46,6 +49,10 @@ public class TimeBasedTriggeringPolicy i
         return false;
     }
 
+    public String toString() {
+        return "TimeBasedTriggeringPolicy";
+    }
+
     @PluginFactory
     public static TimeBasedTriggeringPolicy createPolicy() {
         return new TimeBasedTriggeringPolicy();

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/config/BaseConfiguration.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/BaseConfiguration.java?rev=1103729&r1=1103728&r2=1103729&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/config/BaseConfiguration.java
(original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/config/BaseConfiguration.java
Mon May 16 13:29:03 2011
@@ -491,10 +491,10 @@ public class BaseConfiguration extends F
             logger.debug("Calling " + factoryMethod.getName() + " on class " + clazz.getName()
+ " for element " +
                 node.getName() + sb.toString());
             StringBuilder b = new StringBuilder();
-            if (parms.length > 0) {
+            //if (parms.length > 0) {
                 return factoryMethod.invoke(null, parms);
-            }
-            return factoryMethod.invoke(null, node);
+            //}
+            //return factoryMethod.invoke(null, node);
         }
         catch (Exception e)
         {

Copied: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/AbstractPatternConverter.java
(from r1084027, logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/PatternConverter.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/AbstractPatternConverter.java?p2=logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/AbstractPatternConverter.java&p1=logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/PatternConverter.java&r1=1084027&r2=1103729&rev=1103729&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/PatternConverter.java
(original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/AbstractPatternConverter.java
Mon May 16 13:29:03 2011
@@ -19,14 +19,14 @@ package org.apache.logging.log4j.core.pa
 
 
 /**
- * <p>PatternConverter is an abstract class that provides the
+ * <p>AbstractPatternConverter is an abstract class that provides the
  * formatting functionality that derived classes need.
  * <p/>
  * <p>Conversion specifiers in a conversion patterns are parsed to
  * individual PatternConverters. Each of which is responsible for
  * converting an object in a converter specific manner.
  */
-public abstract class PatternConverter {
+public abstract class AbstractPatternConverter implements PatternConverter {
     /**
      * Converter name.
      */
@@ -43,20 +43,12 @@ public abstract class PatternConverter {
      * @param name  name for pattern converter.
      * @param style CSS style for formatted output.
      */
-    protected PatternConverter(final String name, final String style) {
+    protected AbstractPatternConverter(final String name, final String style) {
         this.name = name;
         this.style = style;
     }
 
     /**
-     * Formats an object into a string buffer.
-     *
-     * @param obj        event to format, may not be null.
-     * @param toAppendTo string buffer to which the formatted event will be appended.  May
not be null.
-     */
-    public abstract void format(final Object obj, final StringBuilder toAppendTo);
-
-    /**
      * This method returns the name of the conversion pattern.
      * <p/>
      * The name can be useful to certain Layouts such as HTMLLayout.

Added: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/ArrayPatternConverter.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/ArrayPatternConverter.java?rev=1103729&view=auto
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/ArrayPatternConverter.java
(added)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/ArrayPatternConverter.java
Mon May 16 13:29:03 2011
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.logging.log4j.core.pattern;
+
+/**
+ * Interface implemented by PatternConverters that accept an array of objects when formatting.
+ */
+public interface ArrayPatternConverter extends PatternConverter {
+
+    void format(Object[] objects, final StringBuilder toAppendTo);
+}

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/DatePatternConverter.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/DatePatternConverter.java?rev=1103729&r1=1103728&r2=1103729&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/DatePatternConverter.java
(original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/DatePatternConverter.java
Mon May 16 13:29:03 2011
@@ -18,12 +18,9 @@
 package org.apache.logging.log4j.core.pattern;
 
 import org.apache.logging.log4j.core.LogEvent;
-import org.apache.logging.log4j.core.appender.rolling.RolloverFrequency;
 import org.apache.logging.log4j.core.config.plugins.Plugin;
 
-import java.text.ParseException;
 import java.text.SimpleDateFormat;
-import java.util.Calendar;
 import java.util.Date;
 import java.util.TimeZone;
 
@@ -33,7 +30,7 @@ import java.util.TimeZone;
  */
 @Plugin(name="DatePatternConverter", type="Converter")
 @ConverterKeys({"d", "date"})
-public final class DatePatternConverter extends LogEventPatternConverter {
+public final class DatePatternConverter extends LogEventPatternConverter implements ArrayPatternConverter
{
     /**
      * ABSOLUTE string literal.
      */
@@ -141,6 +138,15 @@ public final class DatePatternConverter 
         output.append(cachedDate);
     }
 
+    public void format(Object[] objects, final StringBuilder toAppendTo) {
+        for (Object obj : objects) {
+            if (obj instanceof Date) {
+                format(obj, toAppendTo);
+                break;
+            }
+        }
+    }
+
     /**
      * {@inheritDoc}
      */

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/IntegerPatternConverter.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/IntegerPatternConverter.java?rev=1103729&r1=1103728&r2=1103729&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/IntegerPatternConverter.java
(original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/IntegerPatternConverter.java
Mon May 16 13:29:03 2011
@@ -27,7 +27,7 @@ import java.util.Date;
  */
 @Plugin(name="IntegerPatternConverter", type="FileConverter")
 @ConverterKeys({"i", "index"})
-public final class IntegerPatternConverter extends PatternConverter {
+public final class IntegerPatternConverter extends AbstractPatternConverter implements ArrayPatternConverter
{
     /**
      * Singleton.
      */
@@ -52,6 +52,15 @@ public final class IntegerPatternConvert
         return INSTANCE;
     }
 
+    public void format(Object[] objects, final StringBuilder toAppendTo) {
+        for (Object obj : objects) {
+            if (obj instanceof Integer) {
+                format(obj, toAppendTo);
+                break;
+            }
+        }
+    }
+
     /**
      * {@inheritDoc}
      */

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/LiteralPatternConverter.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/LiteralPatternConverter.java?rev=1103729&r1=1103728&r2=1103729&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/LiteralPatternConverter.java
(original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/LiteralPatternConverter.java
Mon May 16 13:29:03 2011
@@ -23,7 +23,7 @@ import org.apache.logging.log4j.core.Log
 /**
  * Formats a string literal.
  */
-public final class LiteralPatternConverter extends LogEventPatternConverter {
+public final class LiteralPatternConverter extends LogEventPatternConverter implements ArrayPatternConverter
{
     /**
      * String literal.
      */
@@ -46,8 +46,11 @@ public final class LiteralPatternConvert
         toAppendTo.append(literal);
     }
 
-    @Override
     public void format(final Object obj, final StringBuilder output) {
         output.append(literal);
     }
+
+    public void format(Object[] objects, final StringBuilder output) {
+        output.append(literal);
+    }
 }

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/LogEventPatternConverter.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/LogEventPatternConverter.java?rev=1103729&r1=1103728&r2=1103729&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/LogEventPatternConverter.java
(original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/LogEventPatternConverter.java
Mon May 16 13:29:03 2011
@@ -25,7 +25,7 @@ import org.apache.logging.log4j.internal
  * LoggingEventPatternConverter is a base class for pattern converters
  * that can format information from instances of LoggingEvent.
  */
-public abstract class LogEventPatternConverter extends PatternConverter {
+public abstract class LogEventPatternConverter extends AbstractPatternConverter {
 
     protected static final Logger logger = StatusLogger.getLogger();
     /**

Added: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/PatternConverter.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/PatternConverter.java?rev=1103729&view=auto
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/PatternConverter.java
(added)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/PatternConverter.java
Mon May 16 13:29:03 2011
@@ -0,0 +1,18 @@
+package org.apache.logging.log4j.core.pattern;
+
+/**
+ *
+ */
+public interface PatternConverter {
+    /**
+     * Formats an object into a string buffer.
+     *
+     * @param obj        event to format, may not be null.
+     * @param toAppendTo string buffer to which the formatted event will be appended.  May
not be null.
+     */
+    void format(Object obj, StringBuilder toAppendTo);
+
+    String getName();
+
+    String getStyleClass(Object e);
+}

Added: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderTimeAndSizeTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderTimeAndSizeTest.java?rev=1103729&view=auto
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderTimeAndSizeTest.java
(added)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderTimeAndSizeTest.java
Mon May 16 13:29:03 2011
@@ -0,0 +1,90 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.logging.log4j.core.appender.rolling;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.core.LoggerContext;
+import org.apache.logging.log4j.core.config.Configuration;
+import org.apache.logging.log4j.core.config.XMLConfigurationFactory;
+import org.apache.logging.log4j.internal.StatusLogger;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import java.io.File;
+
+import static org.junit.Assert.assertTrue;
+
+/**
+ *
+ */
+public class RollingAppenderTimeAndSizeTest {
+
+    private static final String CONFIG = "log4j-rolling3.xml";
+    private static final String DIR = "target/rolling3";
+
+    org.apache.logging.log4j.Logger logger = LogManager.getLogger(RollingAppenderTimeAndSizeTest.class.getName());
+
+    @BeforeClass
+    public static void setupClass() {
+        deleteDir();
+        System.setProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY, CONFIG);
+        LoggerContext ctx = (LoggerContext) LogManager.getContext();
+        Configuration config = ctx.getConfiguration();
+    }
+
+    @AfterClass
+    public static void cleanupClass() {
+        deleteDir();
+        System.clearProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY);
+        LoggerContext ctx = (LoggerContext) LogManager.getContext();
+        ctx.reconfigure();
+        StatusLogger.getLogger().reset();
+    }
+
+    @Test
+    public void testAppender() throws Exception {
+        for (int i=0; i < 100; ++i) {
+            if (i % 11 == 0) {
+                Thread.sleep(1000);
+            }
+            logger.debug("This is test message number " + i);
+        }
+        File dir = new File(DIR);
+        assertTrue("Directory not created", dir.exists() && dir.listFiles().length
> 0);
+        File[] files = dir.listFiles();
+        assertTrue("No files created", files.length > 0);
+        boolean found = false;
+        for (File file : files) {
+            if (file.getName().endsWith(".gz")) {
+                found = true;
+            }
+        }
+        assertTrue("No compressed files found", found);
+    }
+
+    private static void deleteDir() {
+        File dir = new File(DIR);
+        if (dir.exists()) {
+            File[] files = dir.listFiles();
+            for (File file : files) {
+                file.delete();
+            }
+            dir.delete();
+        }
+    }
+}

Copied: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderTimeTest.java
(from r1102953, logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderSizeTest.java)
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderTimeTest.java?p2=logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderTimeTest.java&p1=logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderSizeTest.java&r1=1102953&r2=1103729&rev=1103729&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderSizeTest.java
(original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderTimeTest.java
Mon May 16 13:29:03 2011
@@ -16,50 +16,28 @@
  */
 package org.apache.logging.log4j.core.appender.rolling;
 
-import org.apache.logging.log4j.Level;
 import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.ThreadContext;
-import org.apache.logging.log4j.core.Layout;
-import org.apache.logging.log4j.core.Log4jLogEvent;
-import org.apache.logging.log4j.core.LogEvent;
 import org.apache.logging.log4j.core.LoggerContext;
-import org.apache.logging.log4j.core.appender.OutputStreamManager;
 import org.apache.logging.log4j.core.config.Configuration;
 import org.apache.logging.log4j.core.config.XMLConfigurationFactory;
-import org.apache.logging.log4j.core.layout.PatternLayout;
 import org.apache.logging.log4j.internal.StatusLogger;
-import org.apache.logging.log4j.message.SimpleMessage;
-import org.junit.After;
-import org.junit.Test;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
+import org.junit.Test;
 
-import java.io.BufferedInputStream;
-import java.io.BufferedReader;
-import java.io.DataInputStream;
 import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.TimeUnit;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
 /**
  *
  */
-public class RollingAppenderSizeTest {
+public class RollingAppenderTimeTest {
 
-    private static final String CONFIG = "log4j-rolling1.xml";
-    private static final String DIR = "target/rolling1";
+    private static final String CONFIG = "log4j-rolling2.xml";
+    private static final String DIR = "target/rolling2";
 
-    org.apache.logging.log4j.Logger logger = LogManager.getLogger(RollingAppenderSizeTest.class.getName());
+    org.apache.logging.log4j.Logger logger = LogManager.getLogger(RollingAppenderTimeTest.class.getName());
 
     @BeforeClass
     public static void setupClass() {
@@ -81,6 +59,9 @@ public class RollingAppenderSizeTest {
     @Test
     public void testAppender() throws Exception {
         for (int i=0; i < 100; ++i) {
+            if (i % 11 == 0) {
+                Thread.sleep(1000);
+            }
             logger.debug("This is test message number " + i);
         }
         File dir = new File(DIR);

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/resources/log4j-rolling1.xml
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/resources/log4j-rolling1.xml?rev=1103729&r1=1103728&r2=1103729&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/resources/log4j-rolling1.xml
(original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/resources/log4j-rolling1.xml
Mon May 16 13:29:03 2011
@@ -16,7 +16,6 @@
         <pattern>%d %p %C{1.} [%t] %m%n</pattern>
       </PatternLayout>
       <SizeBasedTriggeringPolicy size="500" />
-      <FixedWindowRolloverStrategy />
     </RollingFile>
     <List name="List">
       <filters>

Copied: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/resources/log4j-rolling2.xml
(from r1102953, logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/resources/log4j-rolling1.xml)
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/resources/log4j-rolling2.xml?p2=logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/resources/log4j-rolling2.xml&p1=logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/resources/log4j-rolling1.xml&r1=1102953&r2=1103729&rev=1103729&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/resources/log4j-rolling1.xml
(original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/resources/log4j-rolling2.xml
Mon May 16 13:29:03 2011
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <configuration packages="" status="debug" name="XMLConfigTest">
   <properties>
-    <property name="filename">target/rolling1/rollingtest.log</property>
+    <property name="filename">target/rolling2/rollingtest.log</property>
   </properties>
   <filters>
     <Threshold level="debug"/>
@@ -11,12 +11,11 @@
     <Console name="STDOUT">
       <PatternLayout pattern="%m%n"/>
     </Console>
-    <RollingFile name="RollingFile" fileName="${filename}" filePattern="target/rolling1/test1-%i.log.gz">
+    <RollingFile name="RollingFile" fileName="${filename}" filePattern="target/rolling2/test1-%d{MM-dd-yy-HH-mm-ss}.log.gz">
       <PatternLayout>
         <pattern>%d %p %C{1.} [%t] %m%n</pattern>
       </PatternLayout>
-      <SizeBasedTriggeringPolicy size="500" />
-      <FixedWindowRolloverStrategy />
+      <TimeBasedTriggeringPolicy />
     </RollingFile>
     <List name="List">
       <filters>
@@ -26,15 +25,6 @@
   </appenders>
 
   <loggers>
-    <logger name="org.apache.logging.log4j.test1" level="debug" additivity="false">
-      <filters>
-        <ThreadContextMap>
-          <KeyValuePair key="test" value="123"/>
-        </ThreadContextMap>
-      </filters>
-      <appender-ref ref="STDOUT"/>
-    </logger>>
-
     <logger name="org.apache.logging.log4j.core.appender.rolling" level="debug" additivity="false">
       <appender-ref ref="RollingFile"/>
     </logger>>

Added: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/resources/log4j-rolling3.xml
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/resources/log4j-rolling3.xml?rev=1103729&view=auto
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/resources/log4j-rolling3.xml
(added)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/resources/log4j-rolling3.xml
Mon May 16 13:29:03 2011
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration packages="" status="debug" name="XMLConfigTest">
+  <properties>
+    <property name="filename">target/rolling3/rollingtest.log</property>
+  </properties>
+  <filters>
+    <Threshold level="debug"/>
+  </filters>
+
+  <appenders>
+    <Console name="STDOUT">
+      <PatternLayout pattern="%m%n"/>
+    </Console>
+    <RollingFile name="RollingFile" fileName="${filename}" filePattern="target/rolling3/test1-%d{MM-dd-yy-HH-mm}-%i.log.gz">
+      <PatternLayout>
+        <pattern>%d %p %C{1.} [%t] %m%n</pattern>
+      </PatternLayout>
+      <Policies>
+        <TimeBasedTriggeringPolicy />
+        <SizeBasedTriggeringPolicy size="500" />
+      </Policies>
+    </RollingFile>
+    <List name="List">
+      <filters>
+        <Threshold level="error"/>
+      </filters>
+    </List>
+  </appenders>
+
+  <loggers>
+    <logger name="org.apache.logging.log4j.core.appender.rolling" level="debug" additivity="false">
+      <appender-ref ref="RollingFile"/>
+    </logger>>
+
+    <root level="error">
+      <appender-ref ref="STDOUT"/>
+    </root>
+  </loggers>
+
+</configuration>
\ No newline at end of file



---------------------------------------------------------------------
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