logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgo...@apache.org
Subject svn commit: r1221457 - in /logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core: appender/ appender/flume/ appender/rolling/ appender/rolling/helper/ appender/routing/ config/ net/
Date Tue, 20 Dec 2011 19:36:29 GMT
Author: rgoers
Date: Tue Dec 20 19:36:28 2011
New Revision: 1221457

URL: http://svn.apache.org/viewvc?rev=1221457&view=rev
Log:
Continue fixing checkstyle and PMD errors

Modified:
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractManager.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/FailoverAppender.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/FileAppender.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/FileManager.java
    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/SocketAppender.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/SyslogAppender.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/flume/Agent.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/flume/FlumeAvroAppender.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/flume/FlumeAvroManager.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/TimeBasedTriggeringPolicy.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/helper/ActionBase.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/helper/CompositeAction.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/helper/GZCompressAction.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/helper/ZipCompressAction.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/routing/Route.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/config/JSONConfigurationFactory.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/net/AbstractJMSManager.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/net/JMSQueueManager.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/net/JMSTopicManager.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/net/TCPSocketManager.java

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractManager.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/AbstractManager.java?rev=1221457&r1=1221456&r2=1221457&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractManager.java (original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractManager.java Tue Dec 20 19:36:28 2011
@@ -32,7 +32,7 @@ public abstract class AbstractManager {
     /**
      * Allow subclasses access to the status logger without creating another instance.
      */
-    protected static Logger logger = StatusLogger.getLogger();
+    protected static final Logger LOGGER = StatusLogger.getLogger();
 
     // Need to lock that map instead of using a ConcurrentMap due to stop removing the
     // manager from the map and closing the stream, requiring the whole stop method to be locked.

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/FailoverAppender.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/FailoverAppender.java?rev=1221457&r1=1221456&r2=1221457&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/FailoverAppender.java (original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/FailoverAppender.java Tue Dec 20 19:36:28 2011
@@ -85,11 +85,6 @@ public final class FailoverAppender exte
         }
     }
 
-    @Override
-    public void stop() {
-        super.stop();
-    }
-
     /**
      * Handle the Log event.
      * @param event The LogEvent.

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/FileAppender.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/FileAppender.java?rev=1221457&r1=1221456&r2=1221457&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/FileAppender.java (original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/FileAppender.java Tue Dec 20 19:36:28 2011
@@ -76,14 +76,14 @@ public final class FileAppender extends 
 
         boolean isAppend = append == null ? true : Boolean.valueOf(append);
         boolean isLocking = locking == null ? false : Boolean.valueOf(locking);
-        boolean isBuffered = bufferedIO == null ? true : Boolean.valueOf(bufferedIO);;
+        boolean isBuffered = bufferedIO == null ? true : Boolean.valueOf(bufferedIO);
         if (isLocking && isBuffered) {
             if (bufferedIO != null) {
                 LOGGER.warn("Locking and buffering are mutually exclusive. No buffereing will occur for " + fileName);
             }
             isBuffered = false;
         }
-        boolean isFlush = immediateFlush == null ? true : Boolean.valueOf(immediateFlush);;
+        boolean isFlush = immediateFlush == null ? true : Boolean.valueOf(immediateFlush);
         boolean handleExceptions = suppress == null ? true : Boolean.valueOf(suppress);
 
         if (name == null) {

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/FileManager.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/FileManager.java?rev=1221457&r1=1221456&r2=1221457&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/FileManager.java (original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/FileManager.java Tue Dec 20 19:36:28 2011
@@ -16,9 +16,6 @@
  */
 package org.apache.logging.log4j.core.appender;
 
-import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.status.StatusLogger;
-
 import java.io.BufferedOutputStream;
 import java.io.File;
 import java.io.FileNotFoundException;
@@ -34,11 +31,6 @@ import java.nio.channels.FileLock;
  */
 public class FileManager extends OutputStreamManager {
 
-    /**
-     * Allow subclasses access to the status logger without creating another instance.
-     */
-    protected static final Logger LOGGER = StatusLogger.getLogger();
-
     private static ManagerFactory factory = new FileManagerFactory();
 
     private boolean isAppend;

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=1221457&r1=1221456&r2=1221457&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 Tue Dec 20 19:36:28 2011
@@ -55,7 +55,7 @@ public class OutputStreamManager extends
             try {
                 this.os.write(header, 0, header.length);
             } catch (IOException ioe) {
-                logger.error("Unable to write header", ioe);
+                LOGGER.error("Unable to write header", ioe);
             }
         }
     }
@@ -131,7 +131,7 @@ public class OutputStreamManager extends
         try {
             os.close();
         } catch (IOException ex) {
-            logger.error("Unable to close stream " + getName() + ". " + ex);
+            LOGGER.error("Unable to close stream " + getName() + ". " + ex);
         }
     }
 

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=1221457&r1=1221456&r2=1221457&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 Tue Dec 20 19:36:28 2011
@@ -63,6 +63,22 @@ public final class RollingFileAppender e
     }
 
     /**
+     * Return the File name for the Appender.
+     * @return The file name.
+     */
+    public String getFileName() {
+        return fileName;
+    }
+
+    /**
+     * Returns the file pattern used when rolling over.
+     * @return The file pattern.
+     */
+    public String getFilePattern() {
+        return filePattern;
+    }
+
+    /**
      * Create a RollingFileAppender.
      * @param fileName The name of the file that is actively written to. (required).
      * @param filePattern The pattern of the file name to use on rollover. (required).
@@ -94,8 +110,8 @@ public final class RollingFileAppender e
 
         boolean isAppend = append == null ? true : Boolean.valueOf(append);
         boolean handleExceptions = suppress == null ? true : Boolean.valueOf(suppress);
-        boolean isBuffered = bufferedIO == null ? true : Boolean.valueOf(bufferedIO);;
-        boolean isFlush = immediateFlush == null ? true : Boolean.valueOf(immediateFlush);;
+        boolean isBuffered = bufferedIO == null ? true : Boolean.valueOf(bufferedIO);
+        boolean isFlush = immediateFlush == null ? true : Boolean.valueOf(immediateFlush);
 
         if (name == null) {
             LOGGER.error("No name provided for FileAppender");

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/SocketAppender.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/SocketAppender.java?rev=1221457&r1=1221456&r2=1221457&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/SocketAppender.java (original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/SocketAppender.java Tue Dec 20 19:36:28 2011
@@ -66,7 +66,7 @@ public class SocketAppender extends Outp
                                                 @PluginElement("layout") Layout layout,
                                                 @PluginElement("filters") Filter filter) {
 
-        boolean isFlush = immediateFlush == null ? true : Boolean.valueOf(immediateFlush);;
+        boolean isFlush = immediateFlush == null ? true : Boolean.valueOf(immediateFlush);
         boolean handleExceptions = suppress == null ? true : Boolean.valueOf(suppress);
         int reconnectDelay = delay == null ? 0 : Integer.parseInt(delay);
         int port = portNum == null ? 0 : Integer.parseInt(portNum);

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/SyslogAppender.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/SyslogAppender.java?rev=1221457&r1=1221456&r2=1221457&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/SyslogAppender.java (original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/SyslogAppender.java Tue Dec 20 19:36:28 2011
@@ -99,7 +99,7 @@ public class SyslogAppender extends Sock
                                                 @PluginConfiguration Configuration config,
                                                 @PluginAttr("charset") String charset) {
 
-        boolean isFlush = immediateFlush == null ? true : Boolean.valueOf(immediateFlush);;
+        boolean isFlush = immediateFlush == null ? true : Boolean.valueOf(immediateFlush);
         boolean handleExceptions = suppress == null ? true : Boolean.valueOf(suppress);
         int reconnectDelay = delay == null ? 0 : Integer.parseInt(delay);
         int port = portNum == null ? 0 : Integer.parseInt(portNum);

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/flume/Agent.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/flume/Agent.java?rev=1221457&r1=1221456&r2=1221457&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/flume/Agent.java (original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/flume/Agent.java Tue Dec 20 19:36:28 2011
@@ -23,39 +23,53 @@ import org.apache.logging.log4j.core.con
 import org.apache.logging.log4j.status.StatusLogger;
 
 /**
- *
+ * Agent Specification for FlumeAvroAppender.
  */
-@Plugin(name="Agent",type="Core",printObject=true)
-public class Agent {
-
-    private final String host;
-
-    private final int port;
+@Plugin(name = "Agent", type = "Core", printObject = true)
+public final class Agent {
 
     private static final String DEFAULT_HOST = "localhost";
 
     private static final int DEFAULT_PORT = 35853;
 
-    private static Logger logger = StatusLogger.getLogger();
+    private static final Logger LOGGER = StatusLogger.getLogger();
+
+    private final String host;
+
+    private final int port;
 
     private Agent(String host, int port) {
         this.host = host;
         this.port = port;
     }
 
+    /**
+     * Retrieve the host name.
+     * @return The name of the host.
+     */
     public String getHost() {
         return host;
     }
 
+    /**
+     * Retrieve the port number.
+     * @return The port number.
+     */
     public int getPort() {
         return port;
     }
 
+    @Override
     public String toString() {
         return "host=" + host + " port=" + port;
     }
 
-
+    /**
+     * Create an Agent.
+     * @param host The host name.
+     * @param port The port number.
+     * @return The Agent.
+     */
     @PluginFactory
     public static Agent createAgent(@PluginAttr("host") String host,
                                     @PluginAttr("port") String port) {
@@ -68,7 +82,7 @@ public class Agent {
             try {
                 portNum = Integer.parseInt(port);
             } catch (Exception ex) {
-                logger.error("Error parsing port number " + port, ex);
+                LOGGER.error("Error parsing port number " + port, ex);
                 return null;
             }
         } else {

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/flume/FlumeAvroAppender.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/flume/FlumeAvroAppender.java?rev=1221457&r1=1221456&r2=1221457&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/flume/FlumeAvroAppender.java (original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/flume/FlumeAvroAppender.java Tue Dec 20 19:36:28 2011
@@ -29,10 +29,10 @@ import org.apache.logging.log4j.core.lay
 import java.net.InetAddress;
 
 /**
- *
+ * An Appender that uses the Avro protocol to route events to Flume.
  */
-@Plugin(name="Flume",type="Core",elementType="appender",printObject=true)
-public class FlumeAvroAppender extends AppenderBase implements FlumeEventFactory {
+@Plugin(name = "Flume", type = "Core", elementType = "appender", printObject = true)
+public final class FlumeAvroAppender extends AppenderBase implements FlumeEventFactory {
 
     private FlumeAvroManager manager;
 
@@ -72,6 +72,10 @@ public class FlumeAvroAppender extends A
         this.factory = factory == null ? this : factory;
     }
 
+    /**
+     * Publish the event.
+     * @param event The LogEvent.
+     */
     public void append(LogEvent event) {
 
         FlumeEvent flumeEvent = factory.createEvent(event, hostname, mdcIncludes, mdcExcludes, mdcRequired, mdcPrefix,
@@ -86,12 +90,42 @@ public class FlumeAvroAppender extends A
         manager.release();
     }
 
+    /**
+     * Create a Flume event.
+     * @param event The Log4j LogEvent.
+     * @param hostname The host name.
+     * @param includes comma separated list of mdc elements to include.
+     * @param excludes comma separated list of mdc elements to exclude.
+     * @param required comma separated list of mdc elements that must be present with a value.
+     * @param mdcPrefix The prefix to add to MDC key names.
+     * @param eventPrefix The prefix to add to event fields.
+     * @param compress If true the body will be compressed.
+     * @return A Flume Event.
+     */
     public FlumeEvent createEvent(LogEvent event, String hostname, String includes, String excludes, String required,
                       String mdcPrefix, String eventPrefix, boolean compress) {
         return new FlumeEvent(event, hostname, mdcIncludes, mdcExcludes, mdcRequired, mdcPrefix,
             eventPrefix, compressBody);
     }
 
+    /**
+     * Create a Flume Avro Appender.
+     * @param agents An array of Agents.
+     * @param delay The amount of time in milliseconds to wait between retries.
+     * @param agentRetries The number of times to retry an agent before failing to the next agent.
+     * @param name The name of the Appender.
+     * @param suppress If true exceptions will be handled in the appender.
+     * @param excludes A comma separated list of MDC elements to exclude.
+     * @param includes A comma separated list of MDC elements to include.
+     * @param required A comma separated list of MDC elements that are required.
+     * @param mdcPrefix The prefix to add to MDC key names.
+     * @param eventPrefix The prefix to add to event key names.
+     * @param compressBody If true the event body will be compressed.
+     * @param factory The factory to use to create Flume events.
+     * @param layout The layout to format the event.
+     * @param filter A Filter to filter events.
+     * @return A Flume Avro Appender.
+     */
     @PluginFactory
     public static FlumeAvroAppender createAppender(@PluginElement("agents") Agent[] agents,
                                                    @PluginAttr("reconnectionDelay") String delay,

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/flume/FlumeAvroManager.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/flume/FlumeAvroManager.java?rev=1221457&r1=1221456&r2=1221457&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/flume/FlumeAvroManager.java (original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/flume/FlumeAvroManager.java Tue Dec 20 19:36:28 2011
@@ -19,41 +19,48 @@ package org.apache.logging.log4j.core.ap
 import com.cloudera.flume.handlers.avro.AvroFlumeEvent;
 import org.apache.avro.ipc.HttpTransceiver;
 import org.apache.avro.ipc.specific.SpecificRequestor;
-import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.core.appender.AbstractManager;
 import org.apache.logging.log4j.core.appender.AppenderRuntimeException;
 import org.apache.logging.log4j.core.appender.ManagerFactory;
 
 import com.cloudera.flume.handlers.avro.FlumeEventAvroServer;
 import com.cloudera.flume.handlers.avro.AvroEventConvertUtil;
-import org.apache.logging.log4j.status.StatusLogger;
 
 import java.io.IOException;
 import java.net.MalformedURLException;
 import java.net.URL;
 
 /**
- *
+ * Manager for FlumeAvroAppenders.
  */
 public class FlumeAvroManager extends AbstractManager {
 
-    private FlumeEventAvroServer client;
-
-    private final Agent[] agents;
-
-    private static final int DEFAULT_RECONNECTS = 3;
-
-    private int current = 0;
-
     /**
       The default reconnection delay (500 milliseconds or .5 seconds).
      */
     public static final int DEFAULT_RECONNECTION_DELAY   = 500;
 
+    private static final int DEFAULT_RECONNECTS = 3;
+
     private static ManagerFactory factory = new AvroManagerFactory();
 
-    private static Logger logger = StatusLogger.getLogger();
+    private FlumeEventAvroServer client;
+
+    private final Agent[] agents;
+
+    private int current = 0;
+
+    protected FlumeAvroManager(String name, Agent[] agents) {
+        super(name);
+        this.agents = agents;
+        this.client = connect(agents);
+    }
 
+    /**
+     * Return a FlumeAvroManager.
+     * @param agents The agents to use.
+     * @return A FlumeAvroManager.
+     */
     public static FlumeAvroManager getManager(Agent[] agents) {
         if (agents == null || agents.length == 0) {
             throw new IllegalArgumentException("At least one agent is required");
@@ -72,11 +79,20 @@ public class FlumeAvroManager extends Ab
         return (FlumeAvroManager) getManager(sb.toString(), factory, new FactoryData(agents));
     }
 
+    /**
+     * Return the agents.
+     * @return The agent array.
+     */
+    public Agent[] getAgents() {
+        return agents;
+    }
 
-    public FlumeAvroManager(String name, Agent[] agents) {
-        super(name);
-        this.agents = agents;
-        this.client = connect(agents);
+    /**
+     * Returns the index of the current agent.
+     * @return The index for the current agent.
+     */
+    public int getCurrent() {
+        return current;
     }
 
     protected synchronized void send(FlumeEvent event, int delay, int retries)  {
@@ -98,7 +114,7 @@ public class FlumeAvroManager extends Ab
             } catch (Exception ex) {
                 if (i == retries - 1) {
                     msg = "Error writing to " + getName() + " at " + agents[0].getHost() + ":" + agents[0].getPort();
-                    logger.warn(msg, ex);
+                    LOGGER.warn(msg, ex);
                     break;
                 }
                 sleep(delay);
@@ -123,7 +139,7 @@ public class FlumeAvroManager extends Ab
                     if (i == retries - 1) {
                         String warnMsg = "Error writing to " + getName() + " at " + agent.getHost() + ":" +
                             agent.getPort();
-                        logger.warn(warnMsg, ex);
+                        LOGGER.warn(warnMsg, ex);
                         break;
                     }
                     sleep(delay);
@@ -167,34 +183,50 @@ public class FlumeAvroManager extends Ab
         try {
             url = new URL("http", hostname, port, "/");
         } catch (MalformedURLException ex) {
-            logger.error("Unable to create a URL for hostname " + hostname + " at port " + port, ex);
+            LOGGER.error("Unable to create a URL for hostname " + hostname + " at port " + port, ex);
             return null;
         }
 
         try {
             return SpecificRequestor.getClient(FlumeEventAvroServer.class, new HttpTransceiver(url));
         } catch (IOException ioe) {
-            logger.error("Unable to create Avro client");
+            LOGGER.error("Unable to create Avro client");
             return null;
         }
     }
 
+    /**
+     * Factory data.
+     */
     private static class FactoryData {
         Agent[] agents;
 
+        /**
+         * Constructor.
+         * @param agents The agents.
+         */
         public FactoryData(Agent[] agents) {
             this.agents = agents;
         }
     }
 
+    /**
+     * Avro Manager Factory.
+     */
     private static class AvroManagerFactory implements ManagerFactory<FlumeAvroManager, FactoryData> {
 
+        /**
+         * Create the FlumeAvroManager.
+         * @param name The name of the entity to manage.
+         * @param data The data required to create the entity.
+         * @return The FlumeAvroManager.
+         */
         public FlumeAvroManager createManager(String name, FactoryData data) {
             try {
 
                 return new FlumeAvroManager(name, data.agents);
             } catch (Exception ex) {
-                logger.error("Could not create FlumeAvroManager", ex);
+                LOGGER.error("Could not create FlumeAvroManager", ex);
             }
             return null;
         }

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=1221457&r1=1221456&r2=1221457&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 Tue Dec 20 19:36:28 2011
@@ -21,26 +21,33 @@ import org.apache.logging.log4j.core.con
 import org.apache.logging.log4j.core.config.plugins.PluginElement;
 import org.apache.logging.log4j.core.config.plugins.PluginFactory;
 
-import java.util.List;
-
 /**
- *
+ * Triggering policy that wraps other policies.
  */
-@Plugin(name="Policies",type="Core",printObject=true)
-public class CompositeTriggeringPolicy implements TriggeringPolicy {
+@Plugin(name = "Policies", type = "Core", printObject = true)
+public final class CompositeTriggeringPolicy implements TriggeringPolicy {
 
     private TriggeringPolicy[] policies;
 
-    public CompositeTriggeringPolicy(TriggeringPolicy[] policies) {
+    private CompositeTriggeringPolicy(TriggeringPolicy[] policies) {
         this.policies = policies;
     }
 
+    /**
+     * Initializes the policy.
+     * @param manager The RollingFileManager.
+     */
     public void initialize(RollingFileManager manager) {
         for (TriggeringPolicy policy : policies) {
             policy.initialize(manager);
         }
     }
 
+    /**
+     * Determines if a rollover should occur.
+     * @param event A reference to the currently event.
+     * @return true if a rollover should occur, false otherwise.
+     */
     public boolean isTriggeringEvent(LogEvent event) {
         for (TriggeringPolicy policy : policies) {
             if (policy.isTriggeringEvent(event)) {
@@ -50,6 +57,7 @@ public class CompositeTriggeringPolicy i
         return false;
     }
 
+    @Override
     public String toString() {
         StringBuilder sb = new StringBuilder("CompositeTriggeringPolicy{");
         boolean first = true;
@@ -64,6 +72,11 @@ public class CompositeTriggeringPolicy i
         return sb.toString();
     }
 
+    /**
+     * Create a CompositeTriggeringPolicy.
+     * @param policies The triggering policies.
+     * @return A CompositeTriggeringPolicy.
+     */
     @PluginFactory
     public static CompositeTriggeringPolicy createPolicy(@PluginElement("policies") TriggeringPolicy[] policies) {
         return new CompositeTriggeringPolicy(policies);

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=1221457&r1=1221456&r2=1221457&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 Tue Dec 20 19:36:28 2011
@@ -19,7 +19,6 @@ package org.apache.logging.log4j.core.ap
 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;
 import org.apache.logging.log4j.core.pattern.PatternConverter;
 import org.apache.logging.log4j.core.pattern.PatternParser;
 
@@ -29,17 +28,13 @@ import java.util.Date;
 import java.util.List;
 
 /**
- *
+ * Parse the rollover pattern.
  */
 public class PatternProcessor {
 
-    private final String pattern;
     private final ArrayPatternConverter[] patternConverters;
     private final FormattingInfo[] patternFields;
 
-    private DatePatternConverter dateConverter = null;
-    private IntegerPatternConverter integerConverter = null;
-
     private static final String KEY = "FileConverter";
 
     private RolloverFrequency frequency = null;
@@ -53,8 +48,11 @@ public class PatternProcessor {
     private static final char SECOND_CHAR = 's';
     private static final char MILLIS_CHAR = 'S';
 
+    /**
+     * Constructor.
+     * @param pattern The file pattern.
+     */
     public PatternProcessor(String pattern) {
-        this.pattern = pattern;
         PatternParser parser = createPatternParser();
         List<PatternConverter> converters = new ArrayList<PatternConverter>();
         List<FormattingInfo> fields = new ArrayList<FormattingInfo>();
@@ -66,18 +64,27 @@ public class PatternProcessor {
 
         for (ArrayPatternConverter converter : patternConverters) {
             if (converter instanceof DatePatternConverter) {
-                dateConverter = (DatePatternConverter) converter;
+                DatePatternConverter dateConverter = (DatePatternConverter) converter;
                 frequency = calculateFrequency(dateConverter.getPattern());
-            } else if (converter instanceof IntegerPatternConverter) {
-                integerConverter = (IntegerPatternConverter) converter;
             }
         }
     }
 
+    /**
+     * Return the next expire time.
+     * @param current The current time.
+     * @return The next expire time.
+     */
     public long getNextTime(long current) {
         return getNextTime(current, 1);
     }
 
+    /**
+     * Return the next potential rollover time.
+     * @param current The current time.
+     * @param increment The increment to the next time.
+     * @return the next potential rollover time.
+     */
     public long getNextTime(long current, int increment) {
         if (frequency == null) {
             throw new IllegalStateException("Pattern does not contain a date");
@@ -151,7 +158,6 @@ public class PatternProcessor {
         }
     }
 
-
     private RolloverFrequency calculateFrequency(String pattern) {
         if (patternContains(pattern, MILLIS_CHAR)) {
             return RolloverFrequency.EVERY_MILLISECOND;

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=1221457&r1=1221456&r2=1221457&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 Tue Dec 20 19:36:28 2011
@@ -16,13 +16,11 @@
  */
 package org.apache.logging.log4j.core.appender.rolling;
 
-import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.core.LogEvent;
 import org.apache.logging.log4j.core.appender.FileManager;
 import org.apache.logging.log4j.core.appender.ManagerFactory;
 import org.apache.logging.log4j.core.appender.rolling.helper.Action;
 import org.apache.logging.log4j.core.appender.rolling.helper.ActionBase;
-import org.apache.logging.log4j.status.StatusLogger;
 
 import java.io.BufferedOutputStream;
 import java.io.File;
@@ -33,66 +31,84 @@ import java.io.OutputStream;
 import java.util.concurrent.Semaphore;
 
 /**
- *
+ * The Rolling File Manager
  */
 public class RollingFileManager extends FileManager {
 
-    /**
-     * Allow subclasses access to the status logger without creating another instance.
-     */
-    protected static final Logger logger = StatusLogger.getLogger();
-
     private long size;
     private long initialTime;
     private PatternProcessor processor;
     private final Semaphore semaphore = new Semaphore(1);
-    private static int count = 0;
 
     private static ManagerFactory factory = new RollingFileManagerFactory();
 
-    public static RollingFileManager getFileManager(String fileName, String pattern, boolean append,
-                                                    boolean bufferedIO) {
-
-        return (RollingFileManager) getManager(fileName, factory, new FactoryData(pattern, append,
-            bufferedIO));
-    }
-
-    public RollingFileManager(String fileName, String pattern, OutputStream os, boolean append, long size, long time) {
+    protected RollingFileManager(String fileName, String pattern, OutputStream os, boolean append, long size,
+                                 long time) {
         super(fileName, os, append, false);
         this.size = size;
         this.initialTime = time;
         processor = new PatternProcessor(pattern);
     }
 
+    /**
+     * Return a RollingFileManager.
+     * @param fileName The file name.
+     * @param pattern The pattern for rolling file.
+     * @param append true if the file should be appended to.
+     * @param bufferedIO true if data should be buffered.
+     * @return A RollingFileManager.
+     */
+    public static RollingFileManager getFileManager(String fileName, String pattern, boolean append,
+                                                    boolean bufferedIO) {
+
+        return (RollingFileManager) getManager(fileName, factory, new FactoryData(pattern, append,
+            bufferedIO));
+    }
 
     protected synchronized void write(byte[] bytes, int offset, int length) {
         size += length;
         super.write(bytes, offset, length);
     }
 
+    /**
+     * Return the current size of the file.
+     * @return The size of the file in bytes.
+     */
     public long getFileSize() {
         return size;
     }
 
+    /**
+     * Return the time the file was created.
+     * @return The time the file was created.
+     */
     public long getFileTime() {
         return initialTime;
     }
 
+    /**
+     * Determine if a rollover should occur.
+     * @param event The LogEvent.
+     * @param policy The TriggeringPolicy.
+     * @param strategy The RolloverStrategy.
+     */
     public synchronized void checkRollover(LogEvent event, TriggeringPolicy policy, RolloverStrategy strategy) {
-        if (policy.isTriggeringEvent(event)) {
-            if (rollover(strategy)) {
-                try {
-                    size = 0;
-                    initialTime = System.currentTimeMillis();
-                    OutputStream os = new FileOutputStream(getFileName(), isAppend());
-                    setOutputStream(os);
-                } catch (FileNotFoundException ex) {
-                    logger.error("FileManager (" + getFileName() + ") " + ex);
-                }
+        if (policy.isTriggeringEvent(event) && rollover(strategy)) {
+            try {
+                size = 0;
+                initialTime = System.currentTimeMillis();
+                OutputStream os = new FileOutputStream(getFileName(), isAppend());
+                setOutputStream(os);
+            } catch (FileNotFoundException ex) {
+                LOGGER.error("FileManager (" + getFileName() + ") " + ex);
             }
         }
     }
 
+    /**
+     * Return the pattern processor.
+     * @return The PatternProcessor.
+     */
     public PatternProcessor getProcessor() {
         return processor;
     }
@@ -103,7 +119,7 @@ public class RollingFileManager extends 
             // Block until the asynchronous operation is completed.
             semaphore.acquire();
         } catch (InterruptedException ie) {
-            logger.error("Thread interrupted while attempting to check rollover", ie);
+            LOGGER.error("Thread interrupted while attempting to check rollover", ie);
             return false;
         }
 
@@ -121,7 +137,7 @@ public class RollingFileManager extends 
                     try {
                         success = descriptor.getSynchronous().execute();
                     } catch (Exception ex) {
-                        logger.error("Error in synchronous task", ex);
+                        LOGGER.error("Error in synchronous task", ex);
                     }
                 }
 
@@ -141,11 +157,19 @@ public class RollingFileManager extends 
         return false;
     }
 
+    /**
+     * Performs actions asynchronously.
+     */
     private static class AsyncAction extends ActionBase {
 
         private final Action action;
         private final RollingFileManager manager;
 
+        /**
+         * Constructor.
+         * @param act The action to perform.
+         * @param manager The manager.
+         */
         public AsyncAction(Action act, RollingFileManager manager) {
             this.action = act;
             this.manager = manager;
@@ -184,11 +208,20 @@ public class RollingFileManager extends 
         }
     }
 
+    /**
+     * Factory data.
+     */
     private static class FactoryData {
         String pattern;
         boolean append;
         boolean bufferedIO;
 
+        /**
+         * Create the data for the factory.
+         * @param pattern The pattern.
+         * @param append The append flag.
+         * @param bufferedIO The bufferedIO flag.
+         */
         public FactoryData(String pattern, boolean append, boolean bufferedIO) {
             this.pattern = pattern;
             this.append = append;
@@ -196,8 +229,17 @@ public class RollingFileManager extends 
         }
     }
 
+    /**
+     * Factory to create a RollingFileManager.
+     */
     private static class RollingFileManagerFactory implements ManagerFactory<RollingFileManager, FactoryData> {
 
+        /**
+         * Create the RollingFileManager.
+         * @param name The name of the entity to manage.
+         * @param data The data required to create the entity.
+         * @return a RollingFileManager.
+         */
         public RollingFileManager createManager(String name, FactoryData data) {
             File file = new File(name);
             final File parent = file.getParentFile();
@@ -207,7 +249,7 @@ public class RollingFileManager extends 
             try {
                 file.createNewFile();
             } catch (IOException ioe) {
-                logger.error("Unable to create file " + name, ioe);
+                LOGGER.error("Unable to create file " + name, ioe);
                 return null;
             }
             long size = data.append ? file.length() : 0;
@@ -221,7 +263,7 @@ public class RollingFileManager extends 
                 }
                 return new RollingFileManager(name, data.pattern, os, data.append, size, time);
             } catch (FileNotFoundException ex) {
-                logger.error("FileManager (" + name + ") " + ex);
+                LOGGER.error("FileManager (" + name + ") " + ex);
             }
             return null;
         }

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=1221457&r1=1221456&r2=1221457&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 Tue Dec 20 19:36:28 2011
@@ -18,25 +18,35 @@ package org.apache.logging.log4j.core.ap
 
 import org.apache.logging.log4j.core.LogEvent;
 import org.apache.logging.log4j.core.config.plugins.Plugin;
-import org.apache.logging.log4j.core.config.plugins.PluginAttr;
 import org.apache.logging.log4j.core.config.plugins.PluginFactory;
 
 /**
- *
+ * Triggering Policy that causes a rollover based on time.
  */
-
 @Plugin(name = "TimeBasedTriggeringPolicy", type = "Core", printObject = true)
-public class TimeBasedTriggeringPolicy implements TriggeringPolicy {
+public final class TimeBasedTriggeringPolicy implements TriggeringPolicy {
 
     private long nextRollover;
 
     private RollingFileManager manager;
 
+    private TimeBasedTriggeringPolicy() {
+    }
+
+    /**
+     * Initialize the policy.
+     * @param manager The RollingFileManager.
+     */
     public void initialize(RollingFileManager manager) {
         this.manager = manager;
         nextRollover = manager.getProcessor().getNextTime(manager.getFileTime());
     }
 
+    /**
+     * Determine whether a rollover should occur.
+     * @param event   A reference to the currently event.
+     * @return true if a rollover should occur.
+     */
     public boolean isTriggeringEvent(LogEvent event) {
         if (manager.getFileSize() == 0) {
             return false;
@@ -49,10 +59,15 @@ public class TimeBasedTriggeringPolicy i
         return false;
     }
 
+    @Override
     public String toString() {
         return "TimeBasedTriggeringPolicy";
     }
 
+    /**
+     * Create a TimeBasedTriggeringPolicy.
+     * @return a 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/appender/rolling/helper/ActionBase.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/helper/ActionBase.java?rev=1221457&r1=1221456&r2=1221457&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/helper/ActionBase.java (original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/helper/ActionBase.java Tue Dec 20 19:36:28 2011
@@ -40,7 +40,7 @@ public abstract class ActionBase impleme
     /**
      * Allow subclasses access to the status logger without creating another instance.
      */
-    protected static final Logger logger = StatusLogger.getLogger();
+    protected static final Logger LOGGER = StatusLogger.getLogger();
 
     /**
      * Constructor.

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/helper/CompositeAction.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/helper/CompositeAction.java?rev=1221457&r1=1221456&r2=1221457&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/helper/CompositeAction.java (original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/helper/CompositeAction.java Tue Dec 20 19:36:28 2011
@@ -56,7 +56,7 @@ public class CompositeAction extends Act
         try {
             execute();
         } catch (IOException ex) {
-            logger.warn("Exception during file rollover.", ex);
+            LOGGER.warn("Exception during file rollover.", ex);
         }
     }
 

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/helper/GZCompressAction.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/helper/GZCompressAction.java?rev=1221457&r1=1221456&r2=1221457&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/helper/GZCompressAction.java (original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/helper/GZCompressAction.java Tue Dec 20 19:36:28 2011
@@ -25,7 +25,6 @@ import java.io.IOException;
 
 import java.util.zip.GZIPOutputStream;
 
-
 /**
  * Compresses a file using GZ compression.
  */
@@ -105,10 +104,8 @@ public final class GZCompressAction exte
             os.close();
             fis.close();
 
-            if (deleteSource) {
-                if (!source.delete()) {
-                    logger.warn("Unable to delete " + source.toString() + ".");
-                }
+            if (deleteSource && !source.delete()) {
+                LOGGER.warn("Unable to delete " + source.toString() + ".");
             }
 
             return true;
@@ -124,7 +121,7 @@ public final class GZCompressAction exte
      * @param ex exception.
      */
     protected void reportException(final Exception ex) {
-        logger.warn("Exception during compression of '" + source.toString() + "'.", ex);
+        LOGGER.warn("Exception during compression of '" + source.toString() + "'.", ex);
     }
 
 }

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/helper/ZipCompressAction.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/helper/ZipCompressAction.java?rev=1221457&r1=1221456&r2=1221457&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/helper/ZipCompressAction.java (original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/helper/ZipCompressAction.java Tue Dec 20 19:36:28 2011
@@ -109,7 +109,7 @@ public final class ZipCompressAction ext
             fis.close();
 
             if (deleteSource && !source.delete()) {
-                logger.warn("Unable to delete " + source.toString() + ".");
+                LOGGER.warn("Unable to delete " + source.toString() + ".");
             }
 
             return true;
@@ -124,6 +124,6 @@ public final class ZipCompressAction ext
      * @param ex exception.
      */
     protected void reportException(final Exception ex) {
-        logger.warn("Exception during compression of '" + source.toString() + "'.", ex);
+        LOGGER.warn("Exception during compression of '" + source.toString() + "'.", ex);
     }
 }

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/routing/Route.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/routing/Route.java?rev=1221457&r1=1221456&r2=1221457&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/routing/Route.java (original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/routing/Route.java Tue Dec 20 19:36:28 2011
@@ -24,13 +24,11 @@ import org.apache.logging.log4j.core.con
 import org.apache.logging.log4j.core.config.plugins.PluginNode;
 import org.apache.logging.log4j.status.StatusLogger;
 
-import java.util.List;
-
 /**
- *
+ * A Route to an appender.
  */
-@Plugin(name="Route", type="Core", printObject=true, deferChildren=true)
-public class Route {
+@Plugin(name = "Route", type = "Core", printObject = true, deferChildren = true)
+public final class Route {
 
     private final Node node;
     private final String appenderRef;
@@ -43,18 +41,31 @@ public class Route {
         this.key = key;
     }
 
+    /**
+     * Return the Dynamic Appender Node.
+     * @return The Node.
+     */
     public Node getNode() {
         return node;
     }
 
+    /**
+     * Returns the appender reference.
+     * @return The Appender reference.
+     */
     public String getAppenderRef() {
         return appenderRef;
     }
 
+    /**
+     * Return the key for this Route.
+     * @return the key for this Route.
+     */
     public String getKey() {
         return key;
     }
 
+    @Override
     public String toString() {
         StringBuilder sb = new StringBuilder("Route(");
         sb.append("type=");
@@ -72,6 +83,13 @@ public class Route {
         return sb.toString();
     }
 
+    /**
+     * Create the Route.
+     * @param appenderRef The Appender reference.
+     * @param key The key.
+     * @param node The Node.
+     * @return A Route.
+     */
     @PluginFactory
     public static Route createRoute(@PluginAttr("appender-ref") String appenderRef,
                                     @PluginAttr("key") String key,

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.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/ConfigurationFactory.java?rev=1221457&r1=1221456&r2=1221457&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java (original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java Tue Dec 20 19:36:28 2011
@@ -61,7 +61,7 @@ public abstract class ConfigurationFacto
 
     private static List<ConfigurationFactory> factories = new ArrayList<ConfigurationFactory>();
 
-    protected static Logger logger = StatusLogger.getLogger();
+    protected static final Logger LOGGER = StatusLogger.getLogger();
 
     protected File configFile = null;
 
@@ -103,9 +103,9 @@ public abstract class ConfigurationFacto
             Class clazz = Class.forName(factoryClass);
             addFactory(clazz);
         } catch (ClassNotFoundException ex) {
-            logger.error("Unable to load class " + factoryClass, ex);
+            LOGGER.error("Unable to load class " + factoryClass, ex);
         } catch (Exception ex) {
-            logger.error("Unable to load class " + factoryClass, ex);
+            LOGGER.error("Unable to load class " + factoryClass, ex);
         }
     }
 
@@ -113,7 +113,7 @@ public abstract class ConfigurationFacto
         try {
             factories.add((ConfigurationFactory) factoryClass.newInstance());
         } catch (Exception ex) {
-            logger.error("Unable to create instance of " + factoryClass.getName(), ex);
+            LOGGER.error("Unable to create instance of " + factoryClass.getName(), ex);
         }
     }
 
@@ -158,7 +158,7 @@ public abstract class ConfigurationFacto
                 source.setSystemId(configLocation.getPath());
                 return source;
             } catch (FileNotFoundException ex) {
-                logger.error("Cannot locate file " + configLocation.getPath(), ex);
+                LOGGER.error("Cannot locate file " + configLocation.getPath(), ex);
             }
         }
         try {
@@ -166,9 +166,9 @@ public abstract class ConfigurationFacto
             source.setSystemId(configLocation.getPath());
             return source;
         } catch (MalformedURLException ex) {
-            logger.error("Invalid URL " + configLocation.toString(), ex);
+            LOGGER.error("Invalid URL " + configLocation.toString(), ex);
         } catch (IOException ex) {
-            logger.error("Unable to access " + configLocation.toString(), ex);
+            LOGGER.error("Unable to access " + configLocation.toString(), ex);
         }
         return null;
     }

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/config/JSONConfigurationFactory.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/JSONConfigurationFactory.java?rev=1221457&r1=1221456&r2=1221457&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/config/JSONConfigurationFactory.java (original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/config/JSONConfigurationFactory.java Tue Dec 20 19:36:28 2011
@@ -45,7 +45,7 @@ public class JSONConfigurationFactory ex
                 Class.forName(item);
             }
         } catch (ClassNotFoundException ex) {
-            logger.debug("Missing dependencies for Json support");
+            LOGGER.debug("Missing dependencies for Json support");
             isActive = false;
             return;
         }

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/net/AbstractJMSManager.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/net/AbstractJMSManager.java?rev=1221457&r1=1221456&r2=1221457&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/net/AbstractJMSManager.java (original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/net/AbstractJMSManager.java Tue Dec 20 19:36:28 2011
@@ -53,7 +53,7 @@ public abstract class AbstractJMSManager
         try {
             return ctx.lookup(name);
         } catch(NameNotFoundException e) {
-            logger.error("Could not find name [" + name + "].");
+            LOGGER.error("Could not find name [" + name + "].");
             throw e;
         }
     }
@@ -66,7 +66,7 @@ public abstract class AbstractJMSManager
             if (providerURL != null) {
                 props.put(Context.PROVIDER_URL, providerURL);
             } else {
-                logger.warn("The InitalContext factory name has been provided without a ProviderURL. " +
+                LOGGER.warn("The InitalContext factory name has been provided without a ProviderURL. " +
                     "This is likely to cause problems");
             }
             if (urlPkgPrefixes != null) {
@@ -77,7 +77,7 @@ public abstract class AbstractJMSManager
 	              if (securityCredentials != null) {
 	                  props.put(Context.SECURITY_CREDENTIALS, securityCredentials);
 	              } else {
-	                  logger.warn("SecurityPrincipalName has been set without SecurityCredentials. " +
+	                  LOGGER.warn("SecurityPrincipalName has been set without SecurityCredentials. " +
                         "This is likely to cause problems.");
 	              }
 	          }
@@ -101,7 +101,7 @@ public abstract class AbstractJMSManager
             }
             producer.send(msg);
         } catch (JMSException ex) {
-            logger.error("Could not publish message via JMS " + getName());
+            LOGGER.error("Could not publish message via JMS " + getName());
             throw ex;
         }
     }

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/net/JMSQueueManager.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/net/JMSQueueManager.java?rev=1221457&r1=1221456&r2=1221457&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/net/JMSQueueManager.java (original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/net/JMSQueueManager.java Tue Dec 20 19:36:28 2011
@@ -47,11 +47,11 @@ public class JMSQueueManager extends Abs
                                                      String userName, String password) {
 
         if (factoryBindingName == null) {
-            logger.error("No factory name provided for JMSQueueManager");
+            LOGGER.error("No factory name provided for JMSQueueManager");
             return null;
         }
         if (queueBindingName == null) {
-            logger.error("No topic name provided for JMSQueueManager");
+            LOGGER.error("No topic name provided for JMSQueueManager");
             return null;
         }
 
@@ -82,7 +82,7 @@ public class JMSQueueManager extends Abs
                 queueConnection.close();
             }
         } catch (JMSException ex) {
-            logger.error("Error closing " + getName(), ex);
+            LOGGER.error("Error closing " + getName(), ex);
         }
     }
 

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/net/JMSTopicManager.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/net/JMSTopicManager.java?rev=1221457&r1=1221456&r2=1221457&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/net/JMSTopicManager.java (original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/net/JMSTopicManager.java Tue Dec 20 19:36:28 2011
@@ -19,11 +19,7 @@ package org.apache.logging.log4j.core.ne
 import org.apache.logging.log4j.core.appender.ManagerFactory;
 
 import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageProducer;
-import javax.jms.ObjectMessage;
 import javax.jms.Session;
-import javax.jms.TextMessage;
 import javax.jms.Topic;
 import javax.jms.TopicConnection;
 import javax.jms.TopicConnectionFactory;
@@ -51,11 +47,11 @@ public class JMSTopicManager extends Abs
                                                      String userName, String password) {
 
         if (factoryBindingName == null) {
-            logger.error("No factory name provided for JMSTopicManager");
+            LOGGER.error("No factory name provided for JMSTopicManager");
             return null;
         }
         if (topicBindingName == null) {
-            logger.error("No topic name provided for JMSTopicManager");
+            LOGGER.error("No topic name provided for JMSTopicManager");
             return null;
         }
 
@@ -86,7 +82,7 @@ public class JMSTopicManager extends Abs
                 topicConnection.close();
             }
         } catch (JMSException ex) {
-            logger.error("Error closing " + getName(), ex);
+            LOGGER.error("Error closing " + getName(), ex);
         }
     }
 
@@ -136,9 +132,9 @@ public class JMSTopicManager extends Abs
                 conn.start();
                 return new JMSTopicManager(name, conn, sess, pub);
             } catch (NamingException ex) {
-                logger.error("Bad Name " + data.topicBindingName, ex);
+                LOGGER.error("Bad Name " + data.topicBindingName, ex);
             } catch (JMSException jmsex) {
-                logger.error("Unable to create publisher ", jmsex);
+                LOGGER.error("Unable to create publisher ", jmsex);
             }
 
             return null;

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/net/TCPSocketManager.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/net/TCPSocketManager.java?rev=1221457&r1=1221456&r2=1221457&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/net/TCPSocketManager.java (original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/net/TCPSocketManager.java Tue Dec 20 19:36:28 2011
@@ -132,13 +132,13 @@ public class TCPSocketManager extends Ab
                         socket = sock;
                         connector = null;
                     }
-                    logger.debug("Connection to " + host + ":" + port + " reestablished.");
+                    LOGGER.debug("Connection to " + host + ":" + port + " reestablished.");
                 } catch (InterruptedException ie) {
-                    logger.debug("Reconnection interrupted.");
+                    LOGGER.debug("Reconnection interrupted.");
                 } catch (ConnectException ex) {
-                    logger.debug(host + ":" + port + " refused connection");
+                    LOGGER.debug(host + ":" + port + " refused connection");
                 } catch (IOException ioe) {
-                    logger.debug("Unable to reconnect to " + host + ":" + port);
+                    LOGGER.debug("Unable to reconnect to " + host + ":" + port);
                 }
             }
         }
@@ -165,9 +165,9 @@ public class TCPSocketManager extends Ab
                 OutputStream os = socket.getOutputStream();
                 return new TCPSocketManager(name, os, socket, address, data.host, data.port, data.delay);
             } catch (UnknownHostException ex) {
-                logger.error("Could not find address of " + data.host, ex);
+                LOGGER.error("Could not find address of " + data.host, ex);
             } catch (IOException ex) {
-                logger.error("TCPSocketManager (" + name + ") " + ex);
+                LOGGER.error("TCPSocketManager (" + name + ") " + ex);
             }
             return null;
         }



Mime
View raw message