logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgo...@apache.org
Subject svn commit: r1221297 - 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/flume/ main/java/org/apache/logging/log4j/core/appender...
Date Tue, 20 Dec 2011 14:54:31 GMT
Author: rgoers
Date: Tue Dec 20 14:54:30 2011
New Revision: 1221297

URL: http://svn.apache.org/viewvc?rev=1221297&view=rev
Log:
Fix some checktyle/javadoc 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/AppenderBase.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/CompressionType.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/DefaultErrorHandler.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/FailoversPlugin.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/JMSQueueAppender.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/JMSTopicAppender.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/ManagerFactory.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/OutputStreamAppender.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/FlumeAvroAppender.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/RewriteAppender.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/routing/RoutingAppender.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/RFC5424Layout.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/java/org/apache/logging/log4j/test/appender/AlwaysFailAppender.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/java/org/apache/logging/log4j/test/appender/ListAppender.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=1221297&r1=1221296&r2=1221297&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 14:54:30 2011
@@ -29,21 +29,26 @@ import java.util.concurrent.locks.Reentr
  */
 public abstract class AbstractManager {
 
+    /**
+     * Allow subclasses access to the status logger without creating another instance.
+     */
+    protected static 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.
     private static Map<String, AbstractManager> map = new HashMap<String, AbstractManager>();
 
     private static Lock lock = new ReentrantLock();
 
-    /**
-     * Allow subclasses access to the status logger without creating another instance.
-     */
-    protected static Logger logger = StatusLogger.getLogger();
-
     private String name;
 
     private int count;
 
+    protected AbstractManager(String name) {
+        this.name = name;
+    }
+
+
     /**
      * Retrieves a Manager if it has been previously created or creates a new Manager.
      * @param name The name of the Manager to retrieve.
@@ -85,10 +90,6 @@ public abstract class AbstractManager {
         }
     }
 
-    protected AbstractManager(String name) {
-        this.name = name;
-    }
-
     /**
      * May be overriden by Managers to perform processing while the Manager is being released and the
      * lock is held.

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/AppenderBase.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/AppenderBase.java?rev=1221297&r1=1221296&r2=1221297&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/AppenderBase.java (original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/AppenderBase.java Tue Dec 20 14:54:30 2011
@@ -27,10 +27,14 @@ import org.apache.logging.log4j.status.S
 import org.apache.logging.log4j.Logger;
 
 /**
- *
- * @doubt Appender should be refactored as mentioned elsewhere
+ * Base class for Appenders. Although Appenders do not have to extend this class, doing so
+ * will simplify their implementation.
  */
 public abstract class AppenderBase extends Filterable implements Appender, Lifecycle {
+    /**
+     * Allow subclasses access to the status logger without creating another instance.
+     */
+    protected static final Logger LOGGER = StatusLogger.getLogger();
 
     /**
      * Appenders set this by calling super.start().
@@ -43,52 +47,75 @@ public abstract class AppenderBase exten
 
     private final boolean handleException;
 
-    /**
-     * Allow subclasses access to the status logger without creating another instance.
-     */
-    protected static final Logger logger = StatusLogger.getLogger();
-
     private ErrorHandler handler = new DefaultErrorHandler(this);
 
-    public static final String NAME = "name";
-
-    public AppenderBase(String name, Filter filter, Layout layout) {
+    /**
+     * Constructor that defaults to suppressing exceptions.
+     * @param name The Appender name.
+     * @param filter The Filter to associate with the Appender.
+     * @param layout The layout to use to format the event.
+     */
+    protected AppenderBase(String name, Filter filter, Layout layout) {
         this(name, filter, layout, true);
     }
 
-    public AppenderBase(String name, Filter filter, Layout layout, boolean handleException) {
+    /**
+     * Constructor.
+     * @param name The Appender name.
+     * @param filter The Filter to associate with the Appender.
+     * @param layout The layout to use to format the event.
+     * @param handleException If true, exceptions will be logged and suppressed. If false errors will be
+     * logged and then passed to the application.
+     */
+    protected AppenderBase(String name, Filter filter, Layout layout, boolean handleException) {
         super(filter);
         this.name = name;
         this.layout = layout;
         this.handleException = handleException;
     }
 
+    /**
+     * Return the ErrorHandler, if any.
+     * @return The ErrorHandler.
+     */
     public ErrorHandler getHandler() {
         return handler;
     }
 
     /**
      * The handler must be set before the appender is started.
+     * @param handler The ErrorHandler to use.
      */
     public void setHandler(ErrorHandler handler) {
         if (handler == null) {
-            logger.error("The handler cannot be set to null");
+            LOGGER.error("The handler cannot be set to null");
         }
         if (isStarted()) {
-            logger.error("The handler cannot be changed once the appender is started");
+            LOGGER.error("The handler cannot be changed once the appender is started");
             return;
         }
         this.handler = handler;
     }
 
+    /**
+     * Close the stream associated with the Appender.
+     */
     public void close() {
 
     }
 
+    /**
+     * Returns the name of the Appender.
+     * @return The name of the Appender.
+     */
     public String getName() {
         return name;
     }
 
+    /**
+     * Returns the Layout for the appender.
+     * @return The Layout used to format the event.
+     */
     public Layout getLayout() {
         return layout;
     }
@@ -96,25 +123,37 @@ public abstract class AppenderBase exten
     /**
      * Some appenders need to propogate exceptions back to the application. When suppressException is false the
      * AppenderControl will allow the exception to percolate.
+     * @return true if exceptions will be supressed, false otherwise.
      */
     public boolean isExceptionSuppressed() {
         return handleException;
     }
 
+    /**
+     * Start the Appender.
+     */
     public void start() {
         startFilter();
         this.started = true;
     }
 
+    /**
+     * Stop the Appender.
+     */
     public void stop() {
         this.started = false;
         stopFilter();
     }
 
+    /**
+     * Returns true if the Appender is started, false otherwise.
+     * @return true if the Appender is started, false otherwise.
+     */
     public boolean isStarted() {
         return started;
     }
 
+    @Override
     public String toString() {
         return name;
     }

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/CompressionType.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/CompressionType.java?rev=1221297&r1=1221296&r2=1221297&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/CompressionType.java (original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/CompressionType.java Tue Dec 20 14:54:30 2011
@@ -17,8 +17,13 @@
 package org.apache.logging.log4j.core.appender;
 
 /**
- *
+ * An enumeration of the valid compression types.
  */
 public enum CompressionType {
-    GZIP, NONE, ZIP
+    /** GZIP. */
+    GZIP,
+    /** No compression. */
+    NONE,
+    /** ZIP. */
+    ZIP
 }

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.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/ConsoleAppender.java?rev=1221297&r1=1221296&r2=1221297&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java (original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java Tue Dec 20 14:54:30 2011
@@ -36,8 +36,8 @@ import java.io.OutputStream;
  * and then call getBytes which may use a configured encoding or the system
  * default. OTOH, a Writer cannot print byte streams.
  */
-@Plugin(name="Console",type="Core",elementType="appender",printObject=true)
-public class ConsoleAppender extends OutputStreamAppender {
+@Plugin(name = "Console", type = "Core", elementType = "appender", printObject = true)
+public final class ConsoleAppender extends OutputStreamAppender {
 
     private static ManagerFactory factory = new ConsoleManagerFactory();
 
@@ -45,9 +45,9 @@ public class ConsoleAppender extends Out
      * Enumeration of console destinations.
      */
     public enum Target {
-        /** Standard output */
+        /** Standard output. */
         SYSTEM_OUT,
-        /** Standard error output */
+        /** Standard error output. */
         SYSTEM_ERR
     }
 
@@ -73,7 +73,7 @@ public class ConsoleAppender extends Out
                                                  @PluginAttr("name") String name,
                                                  @PluginAttr("suppressExceptions") String suppress) {
         if (name == null) {
-            logger.error("No name provided for ConsoleAppender");
+            LOGGER.error("No name provided for ConsoleAppender");
             return null;
         }
         if (layout == null) {
@@ -92,18 +92,35 @@ public class ConsoleAppender extends Out
         return manager;
     }
 
+    /**
+     * Data to pass to factory method.
+     */
     private static class FactoryData {
-        OutputStream os;
-        String type;
+        private OutputStream os;
+        private String type;
 
+        /**
+         * Constructor.
+         * @param os The OutputStream.
+         * @param type The name of the target.
+         */
         public FactoryData(OutputStream os, String type) {
             this.os = os;
             this.type = type;
         }
     }
 
+    /**
+     * Factory to create the Appender.
+     */
     private static class ConsoleManagerFactory implements ManagerFactory<OutputStreamManager, FactoryData> {
 
+        /**
+         * Create an OutputStreamManager.
+         * @param name The name of the entity to manage.
+         * @param data The data required to create the entity.
+         * @return The OutputStreamManager
+         */
         public OutputStreamManager createManager(String name, FactoryData data) {
             return new OutputStreamManager(data.os, data.type);
         }

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/DefaultErrorHandler.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/DefaultErrorHandler.java?rev=1221297&r1=1221296&r2=1221297&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/DefaultErrorHandler.java (original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/DefaultErrorHandler.java Tue Dec 20 14:54:30 2011
@@ -27,16 +27,16 @@ import org.apache.logging.log4j.status.S
  */
 public class DefaultErrorHandler implements ErrorHandler {
 
-    private int exceptionCount = 0;
-
-    private long lastException;
-
-    private static Logger logger = StatusLogger.getLogger();
+    private static final Logger LOGGER = StatusLogger.getLogger();
 
     private static final int MAX_EXCEPTIONS = 3;
 
     private static final int EXCEPTION_INTERVAL = 300000;
 
+    private int exceptionCount = 0;
+
+    private long lastException;
+
     private Appender appender;
 
     public DefaultErrorHandler(Appender appender) {
@@ -51,7 +51,7 @@ public class DefaultErrorHandler impleme
     public void error(String msg) {
         long current = System.currentTimeMillis();
         if (lastException + EXCEPTION_INTERVAL < current || exceptionCount++ < MAX_EXCEPTIONS) {
-            logger.error(msg);
+            LOGGER.error(msg);
         }
         lastException = current;
     }
@@ -64,7 +64,7 @@ public class DefaultErrorHandler impleme
     public void error(String msg, Throwable t) {
         long current = System.currentTimeMillis();
         if (lastException + EXCEPTION_INTERVAL < current || exceptionCount++ < MAX_EXCEPTIONS) {
-            logger.error(msg, t);
+            LOGGER.error(msg, t);
         }
         lastException = current;
         if (!appender.isExceptionSuppressed() && t != null) {
@@ -81,7 +81,7 @@ public class DefaultErrorHandler impleme
     public void error(String msg, LogEvent event, Throwable t) {
         long current = System.currentTimeMillis();
         if (lastException + EXCEPTION_INTERVAL < current || exceptionCount++ < MAX_EXCEPTIONS) {
-            logger.error(msg, t);
+            LOGGER.error(msg, t);
         }
         lastException = current;
         if (!appender.isExceptionSuppressed() && t != null) {

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=1221297&r1=1221296&r2=1221297&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 14:54:30 2011
@@ -37,8 +37,8 @@ import java.util.Map;
  * to a different appender. Hopefully it is obvious that the Appenders must be configured
  * to not suppress exceptions for the FailoverAppender to work.
  */
-@Plugin(name="Failover",type="Core",elementType="appender",printObject=true)
-public class FailoverAppender extends AppenderBase {
+@Plugin(name = "Failover", type = "Core", elementType = "appender", printObject = true)
+public final class FailoverAppender extends AppenderBase {
 
     private final String primaryRef;
 
@@ -50,7 +50,6 @@ public class FailoverAppender extends Ap
 
     private List<AppenderControl> failoverAppenders = new ArrayList<AppenderControl>();
 
-
     private FailoverAppender(String name, Filter filter, String primary, String[] failovers,
                             Configuration config, boolean handleExceptions) {
         super(name, filter, null, handleExceptions);
@@ -67,18 +66,18 @@ public class FailoverAppender extends Ap
         if (map.containsKey(primaryRef)) {
             primary = new AppenderControl(map.get(primaryRef));
         } else {
-            logger.error("Unable to locate primary Appender " + primaryRef);
+            LOGGER.error("Unable to locate primary Appender " + primaryRef);
             ++errors;
         }
         for (String name : failovers) {
             if (map.containsKey(name)) {
                 failoverAppenders.add(new AppenderControl(map.get(name)));
             } else {
-                logger.error("Failover appender " + name + " is not configured");
+                LOGGER.error("Failover appender " + name + " is not configured");
             }
         }
         if (failoverAppenders.size() == 0) {
-            logger.error("No failover appenders are available");
+            LOGGER.error("No failover appenders are available");
             ++errors;
         }
         if (errors == 0) {
@@ -138,7 +137,7 @@ public class FailoverAppender extends Ap
     }
 
     /**
-     * Create a Failover Appender
+     * Create a Failover Appender.
      * @param name The name of the Appender (required).
      * @param primary The name of the primary Appender (required).
      * @param failovers The name of one or more Appenders to fail over to (at least one is required).
@@ -156,15 +155,15 @@ public class FailoverAppender extends Ap
                                                   @PluginElement("filters") Filter filter,
                                                   @PluginAttr("suppressExceptions") String suppress) {
         if (name == null) {
-            logger.error("A name for the Appender must be specified");
+            LOGGER.error("A name for the Appender must be specified");
             return null;
         }
         if (primary == null) {
-            logger.error("A primary Appender must be specified");
+            LOGGER.error("A primary Appender must be specified");
             return null;
         }
         if (failovers == null || failovers.length == 0) {
-            logger.error("At least one failover Appender must be specified");
+            LOGGER.error("At least one failover Appender must be specified");
             return null;
         }
 

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/FailoversPlugin.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/FailoversPlugin.java?rev=1221297&r1=1221296&r2=1221297&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/FailoversPlugin.java (original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/FailoversPlugin.java Tue Dec 20 14:54:30 2011
@@ -23,13 +23,24 @@ import org.apache.logging.log4j.core.con
 import org.apache.logging.log4j.status.StatusLogger;
 
 /**
- *
+ * The array of failover Appenders.
  */
-@Plugin(name="failovers",type="Core")
-public class FailoversPlugin {
+@Plugin(name = "failovers", type = "Core")
+public final class FailoversPlugin {
 
     private static Logger logger = StatusLogger.getLogger();
 
+    /**
+     * Prevent instantiation.
+     */
+    private FailoversPlugin() {
+    }
+
+    /**
+     * Return the appender references.
+     * @param refs The references to return.
+     * @return The appender references.
+     */
     @PluginFactory
     public static String[] createFailovers(@PluginElement("appender-ref") String[] refs) {
 

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=1221297&r1=1221296&r2=1221297&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 14:54:30 2011
@@ -25,10 +25,10 @@ import org.apache.logging.log4j.core.con
 import org.apache.logging.log4j.core.layout.PatternLayout;
 
 /**
- * File Appender
+ * File Appender.
  */
-@Plugin(name="File",type="Core",elementType="appender",printObject=true)
-public class FileAppender extends OutputStreamAppender {
+@Plugin(name = "File", type = "Core", elementType = "appender", printObject = true)
+public final class FileAppender extends OutputStreamAppender {
 
     private final String fileName;
 
@@ -39,7 +39,7 @@ public class FileAppender extends Output
     }
 
     /**
-     * Return the file name this appender is associated with
+     * Return the file name this appender is associated with.
      * @return The File name.
      */
     public String getFileName() {
@@ -47,7 +47,7 @@ public class FileAppender extends Output
     }
 
     /**
-     * Create a File Appender
+     * Create a File Appender.
      * @param fileName The name and path of the file.
      * @param append "True" if the file should be appended to, "false" if it should be overwritten.
      * The default is "true".
@@ -79,7 +79,7 @@ public class FileAppender extends Output
         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);
+                LOGGER.warn("Locking and buffering are mutually exclusive. No buffereing will occur for " + fileName);
             }
             isBuffered = false;
         }
@@ -87,12 +87,12 @@ public class FileAppender extends Output
         boolean handleExceptions = suppress == null ? true : Boolean.valueOf(suppress);
 
         if (name == null) {
-            logger.error("No name provided for FileAppender");
+            LOGGER.error("No name provided for FileAppender");
             return null;
         }
 
         if (fileName == null) {
-            logger.error("No filename provided for FileAppender with name "  + name);
+            LOGGER.error("No filename provided for FileAppender with name "  + name);
             return 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=1221297&r1=1221296&r2=1221297&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 14:54:30 2011
@@ -30,20 +30,34 @@ import java.nio.channels.FileLock;
 
 
 /**
- *
+ * Class that handles actual File I/O for File Appenders.
  */
 public class FileManager extends OutputStreamManager {
 
     /**
      * 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();
+
+    private static ManagerFactory factory = new FileManagerFactory();
 
     private boolean isAppend;
     private boolean isLocking;
 
-    private static ManagerFactory factory = new FileManagerFactory();
+    protected FileManager(String fileName, OutputStream os, boolean append, boolean locking) {
+        super(os, fileName);
+        this.isAppend = append;
+        this.isLocking = locking;
+    }
 
+    /**
+     * Return the FileManager.
+     * @param fileName The name of the file to manage.
+     * @param append true if the file should be appended to, false if it should be overwritten.
+     * @param locking true if the file should be locked while writing, false otherwise.
+     * @param bufferedIO true if the contents should be buffered as they are written.
+     * @return A FileManager for the File.
+     */
     public static FileManager getFileManager(String fileName, boolean append, boolean locking, boolean bufferedIO) {
 
         if (locking && bufferedIO) {
@@ -52,16 +66,10 @@ public class FileManager extends OutputS
         return (FileManager) getManager(fileName, factory, new FactoryData(append, locking, bufferedIO));
     }
 
-    public FileManager(String fileName, OutputStream os, boolean append, boolean locking) {
-        super(os, fileName);
-        this.isAppend = append;
-        this.isLocking = locking;
-    }
-
     protected synchronized void write(byte[] bytes, int offset, int length)  {
 
         if (isLocking) {
-            FileChannel channel = ((FileOutputStream)getOutputStream()).getChannel();
+            FileChannel channel = ((FileOutputStream) getOutputStream()).getChannel();
             try {
                 /* Lock the whole file. This could be optimized to only lock from the current file
                    position. Note that locking may be advisory on some systems and mandatory on others,
@@ -85,23 +93,44 @@ public class FileManager extends OutputS
         }
     }
 
+    /**
+     * Return the name of the File being managed.
+     * @return The name of the File being managed.
+     */
     public String getFileName() {
         return getName();
     }
 
+    /**
+     * Return the append status.
+     * @return true if the file will be appended to, false if it is overwritten.
+     */
     public boolean isAppend() {
         return isAppend;
     }
 
+    /**
+     * Return the lock status.
+     * @return true if the file will be locked when writing, false otherwise.
+     */
     public boolean isLocking() {
         return isLocking;
     }
 
+    /**
+     * Factory Data.
+     */
     private static class FactoryData {
-        boolean append;
-        boolean locking;
-        boolean bufferedIO;
-
+        private boolean append;
+        private boolean locking;
+        private boolean bufferedIO;
+
+        /**
+         * Constructor.
+         * @param append Append status.
+         * @param locking Locking status.
+         * @param bufferedIO Buffering flag.
+         */
         public FactoryData(boolean append, boolean locking, boolean bufferedIO) {
             this.append = append;
             this.locking = locking;
@@ -109,8 +138,17 @@ public class FileManager extends OutputS
         }
     }
 
+    /**
+     * Factory to create a FileManager.
+     */
     private static class FileManagerFactory implements ManagerFactory<FileManager, FactoryData> {
 
+        /**
+         * Create a FileManager.
+         * @param name The name of the File.
+         * @param data The FactoryData
+         * @return The FileManager for the File.
+         */
         public FileManager createManager(String name, FactoryData data) {
             File file = new File(name);
             final File parent = file.getParentFile();
@@ -126,7 +164,7 @@ public class FileManager extends OutputS
                 }
                 return new FileManager(name, os, data.append, data.locking);
             } 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/JMSQueueAppender.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/JMSQueueAppender.java?rev=1221297&r1=1221296&r2=1221297&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/JMSQueueAppender.java (original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/JMSQueueAppender.java Tue Dec 20 14:54:30 2011
@@ -27,10 +27,10 @@ import org.apache.logging.log4j.core.lay
 import org.apache.logging.log4j.core.net.JMSQueueManager;
 
 /**
- *
+ * Appender to write to a JMS Queue.
  */
-@Plugin(name="JMSQueue",type="Core",elementType="appender",printObject=true)
-public class JMSQueueAppender extends AppenderBase {
+@Plugin(name = "JMSQueue", type = "Core", elementType = "appender", printObject = true)
+public final class JMSQueueAppender extends AppenderBase {
 
     private final JMSQueueManager manager;
 
@@ -55,15 +55,16 @@ public class JMSQueueAppender extends Ap
 
     /**
      * Create a JMSQueueAppender.
-     * @param factoryName
-     * @param providerURL
-     * @param urlPkgPrefixes
-     * @param securityPrincipalName
-     * @param securityCredentials
-     * @param factoryBindingName
-     * @param queueBindingName
-     * @param userName
-     * @param password
+     * @param factoryName The fully qualified class name of the InitialContextFactory.
+     * @param providerURL The URL of the provider to use.
+     * @param urlPkgPrefixes A colon-separated list of package prefixes for the class name of the factory class that
+     * will create a URL context factory
+     * @param securityPrincipalName The name of the identity of the Principal.
+     * @param securityCredentials The security credentials of the Principal.
+     * @param factoryBindingName The name to locate in the Context that provides the QueueConnectionFactory.
+     * @param queueBindingName The name to use to locate the Queue.
+     * @param userName The userid to use to create the Queue Connection.
+     * @param password The password to use to create the Queue Connection.
      * @param layout The layout to use (defaults to SerlializedLayout).
      * @param filter The Filter or null.
      * @param suppress "true" if exceptions should be hidden from the application, "false" otherwise.

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/JMSTopicAppender.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/JMSTopicAppender.java?rev=1221297&r1=1221296&r2=1221297&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/JMSTopicAppender.java (original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/JMSTopicAppender.java Tue Dec 20 14:54:30 2011
@@ -27,10 +27,10 @@ import org.apache.logging.log4j.core.lay
 import org.apache.logging.log4j.core.net.JMSTopicManager;
 
 /**
- *
+ * Appender to write to a JMS Topic.
  */
-@Plugin(name="JMSTopic",type="Core",elementType="appender",printObject=true)
-public class JMSTopicAppender extends AppenderBase {
+@Plugin(name = "JMSTopic", type = "Core", elementType = "appender", printObject = true)
+public final class JMSTopicAppender extends AppenderBase {
 
     private final JMSTopicManager manager;
 
@@ -55,15 +55,16 @@ public class JMSTopicAppender extends Ap
 
     /**
      * Create a JMSTopicAppender.
-     * @param factoryName
-     * @param providerURL
-     * @param urlPkgPrefixes
-     * @param securityPrincipalName
-     * @param securityCredentials
-     * @param factoryBindingName
-     * @param topicBindingName
-     * @param userName
-     * @param password
+     * @param factoryName The fully qualified class name of the InitialContextFactory.
+     * @param providerURL The URL of the provider to use.
+     * @param urlPkgPrefixes A colon-separated list of package prefixes for the class name of the factory class that
+     * will create a URL context factory
+     * @param securityPrincipalName The name of the identity of the Principal.
+     * @param securityCredentials The security credentials of the Principal.
+     * @param factoryBindingName The name to locate in the Context that provides the TopicConnectionFactory.
+     * @param topicBindingName The name to use to locate the Topic.
+     * @param userName The userid to use to create the Topic Connection.
+     * @param password The password to use to create the Topic Connection.
      * @param layout The layout to use (defaults to SerlializedLayout).
      * @param filter The Filter or null.
      * @param suppress "true" if exceptions should be hidden from the application, "false" otherwise.

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/ManagerFactory.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/ManagerFactory.java?rev=1221297&r1=1221296&r2=1221297&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/ManagerFactory.java (original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/ManagerFactory.java Tue Dec 20 14:54:30 2011
@@ -17,9 +17,17 @@
 package org.apache.logging.log4j.core.appender;
 
 /**
- *
+ * Create a Manager.
+ * @param <F> The Manager type.
+ * @param <T> The Factory data type.
  */
 public interface ManagerFactory<F, T> {
 
+    /**
+     * Create a Manager.
+     * @param name The name of the entity to manage.
+     * @param data The data required to create the entity.
+     * @return A Manager for the entity.
+     */
     F createManager(String name, T data);
 }

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/OutputStreamAppender.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/OutputStreamAppender.java?rev=1221297&r1=1221296&r2=1221297&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/OutputStreamAppender.java (original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/OutputStreamAppender.java Tue Dec 20 14:54:30 2011
@@ -88,10 +88,10 @@ public abstract class OutputStreamAppend
     @Override
     public void start() {
         if (getLayout() == null) {
-            logger.error("No layout set for the appender named [" + getName() + "].");
+            LOGGER.error("No layout set for the appender named [" + getName() + "].");
         }
         if (manager == null) {
-            logger.error("No OutputStreamManager set for the appender named [" + getName() + "].");
+            LOGGER.error("No OutputStreamManager set for the appender named [" + getName() + "].");
         }
         super.start();
     }

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=1221297&r1=1221296&r2=1221297&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 14:54:30 2011
@@ -29,18 +29,27 @@ public class OutputStreamManager extends
 
     private byte[] footer = null;
 
-    public StringBuilder buffer = new StringBuilder();
+    protected OutputStreamManager(OutputStream os, String streamName) {
+        super(streamName);
+        this.os = os;
+    }
 
+    /**
+     * Create a Manager.
+     * @param name The name of the stream to manage.
+     * @param factory The factory to use to create the Manager.
+     * @param data The data to pass to the Manager.
+     * @return An OutputStreamManager.
+     */
     public static OutputStreamManager getManager(String name, ManagerFactory<OutputStreamManager, Object> factory,
                                                  Object data) {
         return AbstractManager.getManager(name, factory, data);
     }
 
-    public OutputStreamManager(OutputStream os, String streamName) {
-        super(streamName);
-        this.os = os;
-    }
-
+    /**
+     * Set the header to write when the stream is opened.
+     * @param header The header.
+     */
     public synchronized void setHeader(byte[] header) {
         if (header != null) {
             try {
@@ -51,12 +60,19 @@ public class OutputStreamManager extends
         }
     }
 
+    /**
+     * Set the footer to write when the stream is closed.
+     * @param footer The footer.
+     */
     public synchronized void setFooter(byte[] footer) {
         if (footer != null) {
             this.footer = footer;
         }
     }
 
+    /**
+     * Default hook to write footer during close.
+     */
     public void releaseSub() {
         if (footer != null) {
             write(footer);
@@ -64,6 +80,10 @@ public class OutputStreamManager extends
         close();
     }
 
+    /**
+     * Return the status of the stream.
+     * @return true if the stream is open, false if it is not.
+     */
     public boolean isOpen() {
         return getCount() > 0;
     }
@@ -115,6 +135,9 @@ public class OutputStreamManager extends
         }
     }
 
+    /**
+     * Flush any buffers.
+     */
     public void flush() {
         try {
             os.flush();

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=1221297&r1=1221296&r2=1221297&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 14:54:30 2011
@@ -32,11 +32,11 @@ import org.apache.logging.log4j.core.lay
 /**
  * An appender that writes to files andd can roll over at intervals.
  */
-@Plugin(name="RollingFile",type="Core",elementType="appender",printObject=true)
-public class RollingFileAppender extends OutputStreamAppender {
+@Plugin(name = "RollingFile", type = "Core", elementType = "appender", printObject = true)
+public final class RollingFileAppender extends OutputStreamAppender {
 
-    public final String fileName;
-    public final String filePattern;
+    private final String fileName;
+    private final String filePattern;
     private final TriggeringPolicy policy;
     private final RolloverStrategy strategy;
 
@@ -77,7 +77,7 @@ public class RollingFileAppender extends
      * @param filter The Filter or null.
      * @param suppress "true" if exceptions should be hidden from the application, "false" otherwise.
      * The default is "true".
-     * @return
+     * @return A RollingFileAppender.
      */
     @PluginFactory
     public static RollingFileAppender createAppender(@PluginAttr("fileName") String fileName,
@@ -98,22 +98,22 @@ public class RollingFileAppender extends
         boolean isFlush = immediateFlush == null ? true : Boolean.valueOf(immediateFlush);;
 
         if (name == null) {
-            logger.error("No name provided for FileAppender");
+            LOGGER.error("No name provided for FileAppender");
             return null;
         }
 
         if (fileName == null) {
-            logger.error("No filename was provided for FileAppender with name "  + name);
+            LOGGER.error("No filename was provided for FileAppender with name "  + name);
             return null;
         }
 
         if (filePattern == null) {
-            logger.error("No filename pattern provided for FileAppender with name "  + name);
+            LOGGER.error("No filename pattern provided for FileAppender with name "  + name);
             return null;
         }
 
         if (policy == null) {
-            logger.error("A TriggeringPolicy must be provided");
+            LOGGER.error("A TriggeringPolicy must be provided");
             return null;
         }
 

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=1221297&r1=1221296&r2=1221297&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 14:54:30 2011
@@ -31,7 +31,7 @@ import org.apache.logging.log4j.core.net
 /**
  * An Appender that delivers events over socket connections. Supports both TCP and UDP.
  */
-@Plugin(name="Socket",type="Core",elementType="appender",printObject=true)
+@Plugin(name = "Socket", type = "Core", elementType = "appender", printObject = true)
 public class SocketAppender extends OutputStreamAppender {
 
 
@@ -43,17 +43,17 @@ public class SocketAppender extends Outp
 
     /**
      *
-     * @param host
-     * @param portNum
-     * @param protocol
-     * @param delay
-     * @param name
-     * @param immediateFlush
+     * @param host The name of the host to connect to.
+     * @param portNum The port to connect to on the target host.
+     * @param protocol The Protocol to use.
+     * @param delay The interval in which failed writes should be retried.
+     * @param name The name of the Appender.
+     * @param immediateFlush "true" if data should be flushed on each write.
      * @param suppress "true" if exceptions should be hidden from the application, "false" otherwise.
      * The default is "true".
      * @param layout The layout to use (defaults to SerlializedLayout).
      * @param filter The Filter or null.
-     * @return
+     * @return A SocketAppender.
      */
     @PluginFactory
     public static SocketAppender createAppender(@PluginAttr("host") String host,
@@ -75,7 +75,7 @@ public class SocketAppender extends Outp
         }
 
         if (name == null) {
-            logger.error("No name provided for SocketAppender");
+            LOGGER.error("No name provided for SocketAppender");
             return null;
         }
 

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=1221297&r1=1221296&r2=1221297&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 14:54:30 2011
@@ -33,12 +33,12 @@ import java.nio.charset.Charset;
 /**
  * The Syslog Appender.
  */
-@Plugin(name="Syslog",type="Core",elementType="appender",printObject=true)
+@Plugin(name = "Syslog", type = "Core", elementType = "appender", printObject = true)
 public class SyslogAppender extends SocketAppender {
 
-    public static final String BSD = "bsd";
+    private static final String BSD = "bsd";
 
-    public static final String RFC5424 = "RFC5424";
+    private static final String RFC5424 = "RFC5424";
 
     protected SyslogAppender(String name, Layout layout, Filter filter,
                           boolean handleException, boolean immediateFlush, AbstractSocketManager manager) {
@@ -48,28 +48,31 @@ public class SyslogAppender extends Sock
 
     /**
      * Create a SyslogAppender.
-     * @param host
-     * @param portNum
-     * @param protocol
-     * @param delay
-     * @param name
-     * @param immediateFlush
-     * @param suppress
-     * @param facility
-     * @param id
-     * @param ein
-     * @param includeMDC
-     * @param mdcId
-     * @param includeNL
-     * @param appName
-     * @param msgId
-     * @param excludes
-     * @param includes
-     * @param required
-     * @param format
-     * @param filter
-     * @param config
-     * @param charset
+     * @param host The name of the host to connect to.
+     * @param portNum The port to connect to on the target host.
+     * @param protocol The Protocol to use.
+     * @param delay The interval in which failed writes should be retried.
+     * @param name The name of the Appender.
+     * @param immediateFlush "true" if data should be flushed on each write.
+     * @param suppress "true" if exceptions should be hidden from the application, "false" otherwise.
+     * The default is "true".
+     * @param facility The Facility is used to try to classify the message.
+     * @param id The default structured data id to use when formatting according to RFC 5424.
+     * @param ein The IANA enterprise number.
+     * @param includeMDC Indicates whether data from the ThreadContextMap will be included in the RFC 5424 Syslog
+     * record. Defaults to "true:.
+     * @param mdcId The id to use for the MDC Structured Data Element.
+     * @param includeNL If true, a newline will be appended to the end of the syslog record. The default is false.
+     * @param appName The value to use as the APP-NAME in the RFC 5424 syslog record.
+     * @param msgId The default value to be used in the MSGID field of RFC 5424 syslog records.
+     * @param excludes A comma separated list of mdc keys that should be excluded from the LogEvent.
+     * @param includes A comma separated list of mdc keys that should be included in the FlumeEvent.
+     * @param required A comma separated list of mdc keys that must be present in the MDC.
+     * @param format If set to "RFC5424" the data will be formatted in accordance with RFC 5424. Otherwise,
+     * it will be formatted as a BSD Syslog record.
+     * @param filter A Filter to determine if the event should be handled by this Appender.
+     * @param config The Configuration.
+     * @param charset The character set to use when converting the syslog String to a byte array.
      * @return A SyslogAppender.
      */
     @PluginFactory
@@ -105,7 +108,7 @@ public class SyslogAppender extends Sock
             if (Charset.isSupported(charset)) {
                 c = Charset.forName(charset);
             } else {
-                logger.error("Charset " + charset + " is not supported for layout, using " + c.displayName());
+                LOGGER.error("Charset " + charset + " is not supported for layout, using " + c.displayName());
             }
         }
         Layout layout = (format.equalsIgnoreCase(RFC5424)) ?
@@ -114,7 +117,7 @@ public class SyslogAppender extends Sock
             SyslogLayout.createLayout(facility, includeNL, charset);
 
         if (name == null) {
-            logger.error("No name provided for SyslogAppender");
+            LOGGER.error("No name provided for SyslogAppender");
             return null;
         }
         AbstractSocketManager manager = createSocketManager(protocol, host, port, reconnectDelay);

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=1221297&r1=1221296&r2=1221297&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 14:54:30 2011
@@ -112,11 +112,11 @@ public class FlumeAvroAppender extends A
         try {
             hostname = InetAddress.getLocalHost().getHostName();
         } catch (Exception ex) {
-            logger.error("Unable to determine local hostname", ex);
+            LOGGER.error("Unable to determine local hostname", ex);
             return null;
         }
         if (agents == null || agents.length == 0) {
-            logger.debug("No agents provided, using defaults");
+            LOGGER.debug("No agents provided, using defaults");
             agents = new Agent[] {Agent.createAgent(null, null)};
         }
 
@@ -132,7 +132,7 @@ public class FlumeAvroAppender extends A
         }
 
         if (name == null) {
-            logger.error("No name provided for Appender");
+            LOGGER.error("No name provided for Appender");
             return null;
         }
 

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/RewriteAppender.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/rewrite/RewriteAppender.java?rev=1221297&r1=1221296&r2=1221297&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/RewriteAppender.java (original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/RewriteAppender.java Tue Dec 20 14:54:30 2011
@@ -58,7 +58,7 @@ public class RewriteAppender extends App
             if (appender != null) {
                 appenders.put(ref, new AppenderControl(appender));
             } else {
-                logger.error("Appender " + ref + " cannot be located. Reference ignored");
+                LOGGER.error("Appender " + ref + " cannot be located. Reference ignored");
             }
         }
         super.start();
@@ -94,11 +94,11 @@ public class RewriteAppender extends App
         boolean handleExceptions = suppress == null ? true : Boolean.valueOf(suppress);
 
         if (name == null) {
-            logger.error("No name provided for RewriteAppender");
+            LOGGER.error("No name provided for RewriteAppender");
             return null;
         }
         if (appenderRefs == null) {
-            logger.error("No appender references defined for RewriteAppender");
+            LOGGER.error("No appender references defined for RewriteAppender");
             return null;
         }
         return new RewriteAppender(name, filter, handleExceptions, appenderRefs, rewritePolicy, config);

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/routing/RoutingAppender.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/RoutingAppender.java?rev=1221297&r1=1221296&r2=1221297&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/routing/RoutingAppender.java (original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/routing/RoutingAppender.java Tue Dec 20 14:54:30 2011
@@ -29,7 +29,6 @@ import org.apache.logging.log4j.core.con
 import org.apache.logging.log4j.core.config.plugins.PluginConfiguration;
 import org.apache.logging.log4j.core.config.plugins.PluginElement;
 import org.apache.logging.log4j.core.config.plugins.PluginFactory;
-import org.apache.logging.log4j.core.filter.CompositeFilter;
 
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
@@ -69,15 +68,15 @@ public class RoutingAppender extends App
                     String key = route.getKey() == null ? DEFAULT_KEY : route.getKey();
                     if (appenders.containsKey(key)) {
                         if (DEFAULT_KEY.equals(key)) {
-                            logger.error("Multiple default routes. Only the first will be used");
+                            LOGGER.error("Multiple default routes. Only the first will be used");
                         } else {
-                            logger.error("Duplicate route " + key + " is ignored");
+                            LOGGER.error("Duplicate route " + key + " is ignored");
                         }
                     } else {
                         appenders.put(key, new AppenderControl(appender));
                     }
                 } else {
-                    logger.error("Appender " + route.getAppenderRef() + " cannot be located. Route ignored");
+                    LOGGER.error("Appender " + route.getAppenderRef() + " cannot be located. Route ignored");
                 }
             }
         }
@@ -156,11 +155,11 @@ public class RoutingAppender extends App
                     app.start();
                     return (Appender) node.getObject();
                 }
-                logger.error("Unable to create Appender of type " + node.getName());
+                LOGGER.error("Unable to create Appender of type " + node.getName());
                 return null;
             }
         }
-        logger.error("No Appender was configured for route " + route.getKey());
+        LOGGER.error("No Appender was configured for route " + route.getKey());
         return null;
     }
 
@@ -175,11 +174,11 @@ public class RoutingAppender extends App
         boolean handleExceptions = suppress == null ? true : Boolean.valueOf(suppress);
 
         if (name == null) {
-            logger.error("No name provided for RoutingAppender");
+            LOGGER.error("No name provided for RoutingAppender");
             return null;
         }
         if (routes == null) {
-            logger.error("No routes defined for RoutingAppender");
+            LOGGER.error("No routes defined for RoutingAppender");
             return null;
         }
         return new RoutingAppender(name, filter, handleExceptions, routes, rewritePolicy, config);

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/RFC5424Layout.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/layout/RFC5424Layout.java?rev=1221297&r1=1221296&r2=1221297&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/RFC5424Layout.java (original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/RFC5424Layout.java Tue Dec 20 14:54:30 2011
@@ -47,8 +47,8 @@ import java.util.TreeMap;
 /**
  * Formats a log event in accordance with RFC 5424.
  */
-@Plugin(name="RFC5424Layout",type="Core",elementType="layout",printObject=true)
-public class RFC5424Layout extends AbstractStringLayout {
+@Plugin(name = "RFC5424Layout", type = "Core", elementType = "layout", printObject = true)
+public final class RFC5424Layout extends AbstractStringLayout {
 
     private final Facility facility;
     private final String defaultId;
@@ -389,17 +389,18 @@ public class RFC5424Layout extends Abstr
 
     /**
      * Create the RFC 5424 Layout.
-     * @param facility
-     * @param id
-     * @param ein
-     * @param includeMDC
-     * @param mdcId
-     * @param includeNL
-     * @param appName
-     * @param msgId
-     * @param excludes
-     * @param includes
-     * @param required
+     * @param facility The Facility is used to try to classify the message.
+     * @param id The default structured data id to use when formatting according to RFC 5424.
+     * @param ein The IANA enterprise number.
+     * @param includeMDC Indicates whether data from the ThreadContextMap will be included in the RFC 5424 Syslog
+     * record. Defaults to "true:.
+     * @param mdcId The id to use for the MDC Structured Data Element.
+     * @param includeNL If true, a newline will be appended to the end of the syslog record. The default is false.
+     * @param appName The value to use as the APP-NAME in the RFC 5424 syslog record.
+     * @param msgId The default value to be used in the MSGID field of RFC 5424 syslog records.
+     * @param excludes A comma separated list of mdc keys that should be excluded from the LogEvent.
+     * @param includes A comma separated list of mdc keys that should be included in the FlumeEvent.
+     * @param required A comma separated list of mdc keys that must be present in the MDC.
      * @param charset The character set.
      * @param config The Configuration. Some Converters require access to the Interpolator.
      * @return An RFC5424Layout.

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/java/org/apache/logging/log4j/test/appender/AlwaysFailAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/java/org/apache/logging/log4j/test/appender/AlwaysFailAppender.java?rev=1221297&r1=1221296&r2=1221297&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/java/org/apache/logging/log4j/test/appender/AlwaysFailAppender.java (original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/java/org/apache/logging/log4j/test/appender/AlwaysFailAppender.java Tue Dec 20 14:54:30 2011
@@ -40,7 +40,7 @@ public class AlwaysFailAppender extends 
     @PluginFactory
     public static AlwaysFailAppender createAppender(@PluginAttr("name") String name) {
         if (name == null) {
-            logger.error("A name for the Appender must be specified");
+            LOGGER.error("A name for the Appender must be specified");
             return null;
         }
 

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/java/org/apache/logging/log4j/test/appender/ListAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/java/org/apache/logging/log4j/test/appender/ListAppender.java?rev=1221297&r1=1221296&r2=1221297&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/java/org/apache/logging/log4j/test/appender/ListAppender.java (original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/java/org/apache/logging/log4j/test/appender/ListAppender.java Tue Dec 20 14:54:30 2011
@@ -145,7 +145,7 @@ public class ListAppender extends Append
                                               @PluginElement("filters") Filter filter) {
 
         if (name == null) {
-            logger.error("No name provided for ListAppender");
+            LOGGER.error("No name provided for ListAppender");
             return null;
         }
 



Mime
View raw message