logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nickwilli...@apache.org
Subject svn commit: r1504311 - in /logging/log4j/log4j2/trunk: api/src/main/java/org/apache/logging/log4j/ core/src/main/java/org/apache/logging/log4j/core/appender/ core/src/main/java/org/apache/logging/log4j/core/appender/db/ core/src/main/java/org/apache/lo...
Date Wed, 17 Jul 2013 22:32:17 GMT
Author: nickwilliams
Date: Wed Jul 17 22:32:16 2013
New Revision: 1504311

URL: http://svn.apache.org/r1504311
Log:
[LOG4J2-291] Database appenders where always suppressing exceptions. This commit addresses that and also renames AppenderRuntimeException to AppenderLoggingException and changes it to extend LoggingException.

Added:
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/AppenderLoggingException.java
      - copied, changed from r1504205, logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/AppenderRuntimeException.java
Removed:
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/AppenderRuntimeException.java
Modified:
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/LoggingException.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/AbstractOutputStreamAppender.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/DefaultErrorHandler.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FailoverAppender.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FastFileManager.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FileManager.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/JMSQueueAppender.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/JMSTopicAppender.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/OutputStreamManager.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseAppender.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseManager.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/JDBCAppender.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/JDBCDatabaseManager.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/JPAAppender.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/JPADatabaseManager.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/nosql/NoSQLAppender.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/nosql/NoSQLDatabaseManager.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/nosql/couch/CouchDBConnection.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/nosql/mongo/MongoDBConnection.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/FastRollingFileManager.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/AppenderControl.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationException.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/DatagramOutputStream.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/TCPSocketManager.java
    logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseAppenderTest.java
    logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseManagerTest.java
    logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/nosql/NoSQLDatabaseManagerTest.java
    logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/AbstractSocketServerTest.java
    logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/SocketMessageLossTest.java
    logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/SocketReconnectTest.java
    logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/SocketTest.java
    logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAvroManager.java

Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/LoggingException.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/LoggingException.java?rev=1504311&r1=1504310&r2=1504311&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/LoggingException.java (original)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/LoggingException.java Wed Jul 17 22:32:16 2013
@@ -17,38 +17,40 @@
 package org.apache.logging.log4j;
 
 /**
- * Exception thrown when a exception occurs while logging.  In most cases exceptions will be handled
+ * Exception thrown when an error occurs while logging.  In most cases exceptions will be handled
  * within Log4j but certain Appenders may be configured to allow exceptions to propagate to the
  * application. This is a RuntimeException so that the exception may be thrown in those cases without
  * requiring all Logger methods be contained with try/catch blocks.
- *
  */
 public class LoggingException extends RuntimeException {
 
     private static final long serialVersionUID = 6366395965071580537L;
 
     /**
-     * Constructs a LoggingException with a message.
-     * @param msg The message.
+     * Construct an exception with a message.
+     *
+     * @param message The reason for the exception
      */
-    public LoggingException(final String msg) {
-        super(msg);
+    public LoggingException(final String message) {
+        super(message);
     }
 
     /**
-     * Constructs a LoggingException with a message and a chained Exception.
-     * @param msg The message.
-     * @param ex The chained Exception.
+     * Construct an exception with a message and underlying cause.
+     *
+     * @param message The reason for the exception
+     * @param cause The underlying cause of the exception
      */
-    public LoggingException(final String msg, final Exception ex) {
-        super(msg, ex);
+    public LoggingException(final String message, final Throwable cause) {
+        super(message, cause);
     }
 
     /**
-     * Constructs a Logging Exception with a chained Exception and no message.
-     * @param ex The chained Exception.
+     * Construct an exception with an underlying cause.
+     *
+     * @param cause The underlying cause of the exception
      */
-    public LoggingException(final Exception ex) {
-        super(ex);
+    public LoggingException(final Throwable cause) {
+        super(cause);
     }
 }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/AbstractOutputStreamAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/AbstractOutputStreamAppender.java?rev=1504311&r1=1504310&r2=1504311&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/AbstractOutputStreamAppender.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/AbstractOutputStreamAppender.java Wed Jul 17 22:32:16 2013
@@ -117,7 +117,7 @@ public abstract class AbstractOutputStre
                     manager.flush();
                 }
             }
-        } catch (final AppenderRuntimeException ex) {
+        } catch (final AppenderLoggingException ex) {
             error("Unable to write to stream " + manager.getName() + " for appender " + getName());
             throw ex;
         } finally {

Copied: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/AppenderLoggingException.java (from r1504205, logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/AppenderRuntimeException.java)
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/AppenderLoggingException.java?p2=logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/AppenderLoggingException.java&p1=logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/AppenderRuntimeException.java&r1=1504205&r2=1504311&rev=1504311&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/AppenderRuntimeException.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/AppenderLoggingException.java Wed Jul 17 22:32:16 2013
@@ -16,27 +16,48 @@
  */
 package org.apache.logging.log4j.core.appender;
 
+import org.apache.logging.log4j.LoggingException;
+
 /**
- * @doubt unchecked exception again (RG) Why is that a problem? A runtime exception
- * is appropriate in the case where the Appender encounters a checked exception and
- * needs to percolate the exception to the application.
+ * Thrown from an appender when a log event could not be written. Appenders should not thrown an exception if an error
+ * occurs that does <em>not</em> stop the event from being successfully written. Those types of errors should be logged
+ * using the {@link org.apache.logging.log4j.status.StatusLogger}. Appenders should only throw exceptions when an error
+ * prevents an event from being written. Appenders <em>must</em> throw an exception in this case so that error-handling
+ * features like the {@link FailoverAppender} work properly.
+ *
+ * Also note that appenders <em>must</em> provide a way to suppress exceptions when the user desires and abide by
+ * that instruction. See {@link org.apache.logging.log4j.core.Appender#isExceptionSuppressed()}, which is the standard
+ * way to do this.
  */
-public class AppenderRuntimeException extends RuntimeException {
+public class AppenderLoggingException extends LoggingException {
 
-    /**
-     * Generated serial version ID.
-     */
     private static final long serialVersionUID = 6545990597472958303L;
 
-    public AppenderRuntimeException(final String msg) {
-        super(msg);
+    /**
+     * Construct an exception with a message.
+     *
+     * @param message The reason for the exception
+     */
+    public AppenderLoggingException(final String message) {
+        super(message);
     }
 
-    public AppenderRuntimeException(final String msg, final Throwable ex) {
-        super(msg, ex);
+    /**
+     * Construct an exception with a message and underlying cause.
+     *
+     * @param message The reason for the exception
+     * @param cause The underlying cause of the exception
+     */
+    public AppenderLoggingException(final String message, final Throwable cause) {
+        super(message, cause);
     }
 
-    public AppenderRuntimeException(final Throwable ex) {
-        super(ex);
+    /**
+     * Construct an exception with an underlying cause.
+     *
+     * @param cause The underlying cause of the exception
+     */
+    public AppenderLoggingException(final Throwable cause) {
+        super(cause);
     }
 }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/DefaultErrorHandler.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/DefaultErrorHandler.java?rev=1504311&r1=1504310&r2=1504311&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/DefaultErrorHandler.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/DefaultErrorHandler.java Wed Jul 17 22:32:16 2013
@@ -69,8 +69,8 @@ public class DefaultErrorHandler impleme
             LOGGER.error(msg, t);
         }
         lastException = current;
-        if (!appender.isExceptionSuppressed() && t != null && !(t instanceof AppenderRuntimeException)) {
-            throw new AppenderRuntimeException(msg, t);
+        if (!appender.isExceptionSuppressed() && t != null && !(t instanceof AppenderLoggingException)) {
+            throw new AppenderLoggingException(msg, t);
         }
     }
 
@@ -87,8 +87,8 @@ public class DefaultErrorHandler impleme
             LOGGER.error(msg, t);
         }
         lastException = current;
-        if (!appender.isExceptionSuppressed() && t != null && !(t instanceof AppenderRuntimeException)) {
-            throw new AppenderRuntimeException(msg, t);
+        if (!appender.isExceptionSuppressed() && t != null && !(t instanceof AppenderLoggingException)) {
+            throw new AppenderLoggingException(msg, t);
         }
     }
 }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FailoverAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FailoverAppender.java?rev=1504311&r1=1504310&r2=1504311&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FailoverAppender.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FailoverAppender.java Wed Jul 17 22:32:16 2013
@@ -133,7 +133,8 @@ public final class FailoverAppender<T ex
     }
 
     private void failover(final LogEvent event, final Exception ex) {
-        final RuntimeException re = ex != null ? new LoggingException(ex) : null;
+        final RuntimeException re = ex != null ?
+                (ex instanceof LoggingException ? (LoggingException)ex : new LoggingException(ex)) : null;
         boolean written = false;
         Exception failoverException = null;
         for (final AppenderControl control : failoverAppenders) {

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FastFileManager.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FastFileManager.java?rev=1504311&r1=1504310&r2=1504311&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FastFileManager.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FastFileManager.java Wed Jul 17 22:32:16 2013
@@ -110,7 +110,7 @@ public class FastFileManager extends Out
             randomAccessFile.write(buffer.array(), 0, buffer.limit());
         } catch (final IOException ex) {
             final String msg = "Error writing to RandomAccessFile " + getName();
-            throw new AppenderRuntimeException(msg, ex);
+            throw new AppenderLoggingException(msg, ex);
         }
         buffer.clear();
     }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FileManager.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FileManager.java?rev=1504311&r1=1504310&r2=1504311&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FileManager.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FileManager.java Wed Jul 17 22:32:16 2013
@@ -90,7 +90,7 @@ public class FileManager extends OutputS
                     lock.release();
                 }
             } catch (final IOException ex) {
-                throw new AppenderRuntimeException("Unable to obtain lock on " + getName(), ex);
+                throw new AppenderLoggingException("Unable to obtain lock on " + getName(), ex);
             }
 
         } else {

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/JMSQueueAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/JMSQueueAppender.java?rev=1504311&r1=1504310&r2=1504311&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/JMSQueueAppender.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/JMSQueueAppender.java Wed Jul 17 22:32:16 2013
@@ -55,7 +55,7 @@ public final class JMSQueueAppender<T ex
         try {
             manager.send(getLayout().toSerializable(event));
         } catch (final Exception ex) {
-            throw new AppenderRuntimeException(ex);
+            throw new AppenderLoggingException(ex);
         }
     }
 

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/JMSTopicAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/JMSTopicAppender.java?rev=1504311&r1=1504310&r2=1504311&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/JMSTopicAppender.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/JMSTopicAppender.java Wed Jul 17 22:32:16 2013
@@ -55,7 +55,7 @@ public final class JMSTopicAppender<T ex
         try {
             manager.send(getLayout().toSerializable(event));
         } catch (final Exception ex) {
-            throw new AppenderRuntimeException(ex);
+            throw new AppenderLoggingException(ex);
         }
     }
 

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/OutputStreamManager.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/OutputStreamManager.java?rev=1504311&r1=1504310&r2=1504311&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/OutputStreamManager.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/OutputStreamManager.java Wed Jul 17 22:32:16 2013
@@ -107,7 +107,7 @@ public class OutputStreamManager extends
      * @param bytes The serialized Log event.
      * @param offset The offset into the byte array.
      * @param length The number of bytes to write.
-     * @throws AppenderRuntimeException if an error occurs.
+     * @throws AppenderLoggingException if an error occurs.
      */
     protected synchronized void write(final byte[] bytes, final int offset, final int length)  {
         //System.out.println("write " + count);
@@ -115,7 +115,7 @@ public class OutputStreamManager extends
             os.write(bytes, offset, length);
         } catch (final IOException ex) {
             final String msg = "Error writing to stream " + getName();
-            throw new AppenderRuntimeException(msg, ex);
+            throw new AppenderLoggingException(msg, ex);
         }
     }
 
@@ -123,7 +123,7 @@ public class OutputStreamManager extends
      * Some output streams synchronize writes while others do not. Synchronizing here insures that
      * log events won't be intertwined.
      * @param bytes The serialized Log event.
-     * @throws AppenderRuntimeException if an error occurs.
+     * @throws AppenderLoggingException if an error occurs.
      */
     protected void write(final byte[] bytes)  {
         write(bytes, 0, bytes.length);
@@ -149,7 +149,7 @@ public class OutputStreamManager extends
             os.flush();
         } catch (final IOException ex) {
             final String msg = "Error flushing stream " + getName();
-            throw new AppenderRuntimeException(msg, ex);
+            throw new AppenderLoggingException(msg, ex);
         }
     }
 }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseAppender.java?rev=1504311&r1=1504310&r2=1504311&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseAppender.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseAppender.java Wed Jul 17 22:32:16 2013
@@ -24,7 +24,7 @@ import org.apache.logging.log4j.core.Fil
 import org.apache.logging.log4j.core.Layout;
 import org.apache.logging.log4j.core.LogEvent;
 import org.apache.logging.log4j.core.appender.AbstractAppender;
-import org.apache.logging.log4j.core.appender.AppenderRuntimeException;
+import org.apache.logging.log4j.core.appender.AppenderLoggingException;
 
 /**
  * An abstract Appender for writing events to a database of some type, be it relational or NoSQL. All database appenders
@@ -46,12 +46,12 @@ public abstract class AbstractDatabaseAp
      * 
      * @param name The appender name.
      * @param filter The filter, if any, to use.
-     * @param handleException Whether logging exceptions should be reported to the application.
+     * @param exceptionSuppressed Whether logging exceptions should be suppressed or reported to the application.
      * @param manager The matching {@link AbstractDatabaseManager} implementation.
      */
-    protected AbstractDatabaseAppender(final String name, final Filter filter, final boolean handleException,
+    protected AbstractDatabaseAppender(final String name, final Filter filter, final boolean exceptionSuppressed,
                                        final T manager) {
-        super(name, filter, null, handleException);
+        super(name, filter, null, exceptionSuppressed);
         this.manager = manager;
     }
 
@@ -78,7 +78,7 @@ public abstract class AbstractDatabaseAp
     @Override
     public final void start() {
         if (this.getManager() == null) {
-            LOGGER.error("No AbstractDatabaseManager set for the appender named [" + this.getName() + "].");
+            LOGGER.error("No AbstractDatabaseManager set for the appender named [{}].", this.getName());
         }
         super.start();
         if (this.getManager() != null) {
@@ -99,10 +99,16 @@ public abstract class AbstractDatabaseAp
         this.readLock.lock();
         try {
             this.getManager().write(event);
-        } catch (final AppenderRuntimeException e) {
-            this.error("Unable to write to database [" + this.getManager().getName() + "] for appender [" +
-                    this.getName() + "].", e);
-            throw e;
+        } catch (final RuntimeException e) {
+            LOGGER.error("Unable to write to database [{}] for appender [{}].", this.getManager().getName(),
+                    this.getName(), e);
+            if(!this.isExceptionSuppressed())
+                throw e;
+        } catch (final Exception e) {
+            LOGGER.error("Unable to write to database [{}] for appender [{}].", this.getManager().getName(),
+                    this.getName(), e);
+            if(!this.isExceptionSuppressed())
+                throw new AppenderLoggingException("Unable to write to database in appender: " + e.getMessage(), e);
         } finally {
             this.readLock.unlock();
         }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseManager.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseManager.java?rev=1504311&r1=1504310&r2=1504311&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseManager.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseManager.java Wed Jul 17 22:32:16 2013
@@ -48,7 +48,7 @@ public abstract class AbstractDatabaseMa
      * Implementations should implement this method to perform any proprietary connection operations. This method will
      * never be called twice on the same instance. It is safe to throw any exceptions from this method.
      */
-    protected abstract void connectInternal();
+    protected abstract void connectInternal() throws Exception;
 
     /**
      * This method is called within the appender when the appender is started. If it has not already been called, it
@@ -60,7 +60,7 @@ public abstract class AbstractDatabaseMa
                 this.connectInternal();
                 this.connected = true;
             } catch (final Exception e) {
-                LOGGER.error("Could not connect database logging manager.", e);
+                LOGGER.error("Could not connect to database using logging manager [{}].", this.getName(), e);
             }
         }
     }
@@ -70,7 +70,7 @@ public abstract class AbstractDatabaseMa
      * method will never be called twice on the same instance, and it will only be called <em>after</em>
      * {@link #connectInternal()}. It is safe to throw any exceptions from this method.
      */
-    protected abstract void disconnectInternal();
+    protected abstract void disconnectInternal() throws Exception;
 
     /**
      * This method is called from the {@link #release()} method when the appender is stopped or the appender's manager
@@ -83,7 +83,7 @@ public abstract class AbstractDatabaseMa
             try {
                 this.disconnectInternal();
             } catch (final Exception e) {
-                LOGGER.warn("Error while disconnecting database logging manager.", e);
+                LOGGER.warn("Error while disconnecting from database using logging manager [{}].", this.getName(), e);
             } finally {
                 this.connected = false;
             }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/JDBCAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/JDBCAppender.java?rev=1504311&r1=1504310&r2=1504311&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/JDBCAppender.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/JDBCAppender.java Wed Jul 17 22:32:16 2013
@@ -23,7 +23,6 @@ import org.apache.logging.log4j.core.con
 import org.apache.logging.log4j.core.config.plugins.PluginAttr;
 import org.apache.logging.log4j.core.config.plugins.PluginElement;
 import org.apache.logging.log4j.core.config.plugins.PluginFactory;
-import org.apache.logging.log4j.core.helpers.Strings;
 
 /**
  * This Appender writes logging events to a relational database using standard JDBC mechanisms. It takes a list of
@@ -38,9 +37,9 @@ import org.apache.logging.log4j.core.hel
 public final class JDBCAppender extends AbstractDatabaseAppender<JDBCDatabaseManager> {
     private final String description;
 
-    private JDBCAppender(final String name, final Filter filter, final boolean handleException,
+    private JDBCAppender(final String name, final Filter filter, final boolean exceptionSuppressed,
                          final JDBCDatabaseManager manager) {
-        super(name, filter, handleException, manager);
+        super(name, filter, exceptionSuppressed, manager);
         this.description = this.getName() + "{ manager=" + this.getManager() + " }";
     }
 
@@ -75,7 +74,7 @@ public final class JDBCAppender extends 
                                               @PluginElement("columnConfigs") final ColumnConfig[] columnConfigs) {
 
         final int bufferSizeInt = AbstractAppender.parseInt(bufferSize, 0);
-        final boolean handleExceptions = !Boolean.parseBoolean(suppressExceptions);
+        final boolean exceptionSuppressed = Boolean.parseBoolean(suppressExceptions);
 
         final StringBuilder managerName = new StringBuilder("jdbcManager{ description=").append(name)
                 .append(", bufferSize=").append(bufferSizeInt).append(", connectionSource=")
@@ -98,6 +97,6 @@ public final class JDBCAppender extends 
             return null;
         }
 
-        return new JDBCAppender(name, filter, handleExceptions, manager);
+        return new JDBCAppender(name, filter, exceptionSuppressed, manager);
     }
 }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/JDBCDatabaseManager.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/JDBCDatabaseManager.java?rev=1504311&r1=1504310&r2=1504311&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/JDBCDatabaseManager.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/JDBCDatabaseManager.java Wed Jul 17 22:32:16 2013
@@ -25,6 +25,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.logging.log4j.core.LogEvent;
+import org.apache.logging.log4j.core.appender.AppenderLoggingException;
 import org.apache.logging.log4j.core.appender.ManagerFactory;
 import org.apache.logging.log4j.core.appender.db.AbstractDatabaseManager;
 import org.apache.logging.log4j.core.layout.PatternLayout;
@@ -51,32 +52,21 @@ public final class JDBCDatabaseManager e
     }
 
     @Override
-    protected void connectInternal() {
-        try {
-            this.connection = this.connectionSource.getConnection();
-            this.statement = this.connection.prepareStatement(this.sqlStatement);
-        } catch (final SQLException e) {
-            LOGGER.error("Failed to connect to relational database using JDBC connection source [{}] in manager [{}].",
-                    this.connectionSource, this.getName(), e);
-        }
+    protected void connectInternal() throws SQLException {
+        this.connection = this.connectionSource.getConnection();
+        this.statement = this.connection.prepareStatement(this.sqlStatement);
     }
 
     @Override
-    protected void disconnectInternal() {
+    protected void disconnectInternal() throws SQLException {
         try {
             if (this.statement != null && !this.statement.isClosed()) {
                 this.statement.close();
             }
-        } catch (final SQLException e) {
-            LOGGER.warn("Error while closing prepared statement in database manager [{}].", this.getName(), e);
-        }
-
-        try {
+        } finally {
             if (this.connection != null && !this.connection.isClosed()) {
                 this.connection.close();
             }
-        } catch (final SQLException e) {
-            LOGGER.warn("Error while disconnecting from relational database in manager [{}].", this.getName(), e);
         }
     }
 
@@ -85,8 +75,8 @@ public final class JDBCDatabaseManager e
         StringReader reader = null;
         try {
             if (!this.isConnected() || this.connection == null || this.connection.isClosed()) {
-                LOGGER.error("Cannot write logging event; manager [{}] not connected to the database.", this.getName());
-                return;
+                throw new AppenderLoggingException(
+                        "Cannot write logging event; JDBC manager not connected to the database.");
             }
 
             int i = 1;
@@ -112,10 +102,12 @@ public final class JDBCDatabaseManager e
             }
 
             if (this.statement.executeUpdate() == 0) {
-                LOGGER.warn("No records inserted in database table for log event in manager [{}].", this.getName());
+                throw new AppenderLoggingException(
+                        "No records inserted in database table for log event in JDBC manager.");
             }
         } catch (final SQLException e) {
-            LOGGER.error("Failed to insert record for log event in manager [{}].", this.getName(), e);
+            throw new AppenderLoggingException("Failed to insert record for log event in JDBC manager: " +
+                    e.getMessage(), e);
         } finally {
             if (reader != null) {
                 reader.close();

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/JPAAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/JPAAppender.java?rev=1504311&r1=1504310&r2=1504311&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/JPAAppender.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/JPAAppender.java Wed Jul 17 22:32:16 2013
@@ -39,9 +39,9 @@ import org.apache.logging.log4j.core.hel
 public final class JPAAppender extends AbstractDatabaseAppender<JPADatabaseManager> {
     private final String description;
 
-    private JPAAppender(final String name, final Filter filter, final boolean handleException,
+    private JPAAppender(final String name, final Filter filter, final boolean exceptionSuppressed,
             final JPADatabaseManager manager) {
-        super(name, filter, handleException, manager);
+        super(name, filter, exceptionSuppressed, manager);
         this.description = this.getName() + "{ manager=" + this.getManager() + " }";
     }
 
@@ -77,7 +77,7 @@ public final class JPAAppender extends A
         }
 
         final int bufferSizeInt = AbstractAppender.parseInt(bufferSize, 0);
-        final boolean handleExceptions = !Boolean.parseBoolean(suppressExceptions);
+        final boolean exceptionSuppressed = Boolean.parseBoolean(suppressExceptions);
 
         try {
             @SuppressWarnings("unchecked")
@@ -110,7 +110,7 @@ public final class JPAAppender extends A
                 return null;
             }
 
-            return new JPAAppender(name, filter, handleExceptions, manager);
+            return new JPAAppender(name, filter, exceptionSuppressed, manager);
         } catch (final ClassNotFoundException e) {
             LOGGER.error("Could not load entity class [{}].", entityClassName, e);
             return null;

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/JPADatabaseManager.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/JPADatabaseManager.java?rev=1504311&r1=1504310&r2=1504311&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/JPADatabaseManager.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/JPADatabaseManager.java Wed Jul 17 22:32:16 2013
@@ -23,6 +23,7 @@ import javax.persistence.EntityTransacti
 import javax.persistence.Persistence;
 
 import org.apache.logging.log4j.core.LogEvent;
+import org.apache.logging.log4j.core.appender.AppenderLoggingException;
 import org.apache.logging.log4j.core.appender.ManagerFactory;
 import org.apache.logging.log4j.core.appender.db.AbstractDatabaseManager;
 
@@ -63,16 +64,15 @@ public final class JPADatabaseManager ex
     @Override
     protected void writeInternal(final LogEvent event) {
         if (!this.isConnected() || this.entityManagerFactory == null) {
-            LOGGER.error("Cannot write logging event; manager [{}] not connected to the database.", this.getName());
-            return;
+            throw new AppenderLoggingException(
+                    "Cannot write logging event; JPA manager not connected to the database.");
         }
 
         AbstractLogEventWrapperEntity entity;
         try {
             entity = this.entityConstructor.newInstance(event);
         } catch (final Exception e) {
-            LOGGER.error("Failed to instantiate entity class {}.", this.entityClassName, e);
-            return;
+            throw new AppenderLoggingException("Failed to instantiate entity class [" + this.entityClassName + "].", e);
         }
 
         EntityManager entityManager = null;
@@ -84,10 +84,11 @@ public final class JPADatabaseManager ex
             entityManager.persist(entity);
             transaction.commit();
         } catch (final Exception e) {
-            LOGGER.error("Failed to persist log event entity.", e);
             if (transaction != null && transaction.isActive()) {
                 transaction.rollback();
             }
+            throw new AppenderLoggingException("Failed to insert record for log event in JDBC manager: " +
+                    e.getMessage(), e);
         } finally {
             if (entityManager != null && entityManager.isOpen()) {
                 entityManager.close();

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/nosql/NoSQLAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/nosql/NoSQLAppender.java?rev=1504311&r1=1504310&r2=1504311&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/nosql/NoSQLAppender.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/nosql/NoSQLAppender.java Wed Jul 17 22:32:16 2013
@@ -23,7 +23,6 @@ import org.apache.logging.log4j.core.con
 import org.apache.logging.log4j.core.config.plugins.PluginAttr;
 import org.apache.logging.log4j.core.config.plugins.PluginElement;
 import org.apache.logging.log4j.core.config.plugins.PluginFactory;
-import org.apache.logging.log4j.core.helpers.Strings;
 
 /**
  * This Appender writes logging events to a NoSQL database using a configured NoSQL provider. It requires
@@ -41,9 +40,9 @@ import org.apache.logging.log4j.core.hel
 public final class NoSQLAppender extends AbstractDatabaseAppender<NoSQLDatabaseManager<?>> {
     private final String description;
 
-    private NoSQLAppender(final String name, final Filter filter, final boolean handleException,
+    private NoSQLAppender(final String name, final Filter filter, final boolean exceptionSuppressed,
                           final NoSQLDatabaseManager<?> manager) {
-        super(name, filter, handleException, manager);
+        super(name, filter, exceptionSuppressed, manager);
         this.description = this.getName() + "{ manager=" + this.getManager() + " }";
     }
 
@@ -76,7 +75,7 @@ public final class NoSQLAppender extends
         }
 
         final int bufferSizeInt = AbstractAppender.parseInt(bufferSize, 0);
-        final boolean handleExceptions = !Boolean.parseBoolean(suppressExceptions);
+        final boolean exceptionSuppressed = Boolean.parseBoolean(suppressExceptions);
 
         final String managerName = "noSqlManager{ description=" + name + ", bufferSize=" + bufferSizeInt
                 + ", provider=" + provider + " }";
@@ -88,6 +87,6 @@ public final class NoSQLAppender extends
             return null;
         }
 
-        return new NoSQLAppender(name, filter, handleExceptions, manager);
+        return new NoSQLAppender(name, filter, exceptionSuppressed, manager);
     }
 }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/nosql/NoSQLDatabaseManager.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/nosql/NoSQLDatabaseManager.java?rev=1504311&r1=1504310&r2=1504311&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/nosql/NoSQLDatabaseManager.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/nosql/NoSQLDatabaseManager.java Wed Jul 17 22:32:16 2013
@@ -21,6 +21,7 @@ import java.util.Map;
 import org.apache.logging.log4j.Marker;
 import org.apache.logging.log4j.ThreadContext;
 import org.apache.logging.log4j.core.LogEvent;
+import org.apache.logging.log4j.core.appender.AppenderLoggingException;
 import org.apache.logging.log4j.core.appender.ManagerFactory;
 import org.apache.logging.log4j.core.appender.db.AbstractDatabaseManager;
 
@@ -44,29 +45,21 @@ public final class NoSQLDatabaseManager<
 
     @Override
     protected void connectInternal() {
-        try {
-            this.connection = this.provider.getConnection();
-        } catch (final Exception e) {
-            LOGGER.error("Failed to obtain a connection to the NoSQL database in manager [{}].", this.getName(), e);
-        }
+        this.connection = this.provider.getConnection();
     }
 
     @Override
     protected void disconnectInternal() {
-        try {
-            if (this.connection != null && !this.connection.isClosed()) {
-                this.connection.close();
-            }
-        } catch (final Exception e) {
-            LOGGER.warn("Error while closing NoSQL database connection in manager [{}].", this.getName(), e);
+        if (this.connection != null && !this.connection.isClosed()) {
+            this.connection.close();
         }
     }
 
     @Override
     protected void writeInternal(final LogEvent event) {
         if (!this.isConnected() || this.connection == null || this.connection.isClosed()) {
-            LOGGER.error("Cannot write logging event; manager [{}] not connected to the database.", this.getName());
-            return;
+            throw new AppenderLoggingException(
+                    "Cannot write logging event; NoSQL manager not connected to the database.");
         }
 
         final NoSQLObject<W> entity = this.connection.createObject();

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/nosql/couch/CouchDBConnection.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/nosql/couch/CouchDBConnection.java?rev=1504311&r1=1504310&r2=1504311&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/nosql/couch/CouchDBConnection.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/nosql/couch/CouchDBConnection.java Wed Jul 17 22:32:16 2013
@@ -18,10 +18,9 @@ package org.apache.logging.log4j.core.ap
 
 import java.util.Map;
 
-import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.core.appender.AppenderLoggingException;
 import org.apache.logging.log4j.core.appender.db.nosql.NoSQLConnection;
 import org.apache.logging.log4j.core.appender.db.nosql.NoSQLObject;
-import org.apache.logging.log4j.status.StatusLogger;
 import org.lightcouch.CouchDbClient;
 import org.lightcouch.Response;
 
@@ -29,8 +28,6 @@ import org.lightcouch.Response;
  * The Apache CouchDB implementation of {@link NoSQLConnection}.
  */
 public final class CouchDBConnection implements NoSQLConnection<Map<String, Object>, CouchDBObject> {
-    private static final Logger LOGGER = StatusLogger.getLogger();
-
     private final CouchDbClient client;
     private boolean closed = false;
 
@@ -53,10 +50,12 @@ public final class CouchDBConnection imp
         try {
             final Response response = this.client.save(object.unwrap());
             if (response.getError() != null && response.getError().length() > 0) {
-                LOGGER.error("Failed to write log event to CouchDB due to error: [{}].", response.getError());
+                throw new AppenderLoggingException("Failed to write log event to CouchDB due to error: " +
+                        response.getError() + ".");
             }
         } catch (final Exception e) {
-            LOGGER.error("Failed to write log event to CouchDB due to error.", e);
+            throw new AppenderLoggingException("Failed to write log event to CouchDB due to error: " + e.getMessage(),
+                    e);
         }
     }
 

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/nosql/mongo/MongoDBConnection.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/nosql/mongo/MongoDBConnection.java?rev=1504311&r1=1504310&r2=1504311&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/nosql/mongo/MongoDBConnection.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/nosql/mongo/MongoDBConnection.java Wed Jul 17 22:32:16 2013
@@ -16,10 +16,9 @@
  */
 package org.apache.logging.log4j.core.appender.db.nosql.mongo;
 
-import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.core.appender.AppenderLoggingException;
 import org.apache.logging.log4j.core.appender.db.nosql.NoSQLConnection;
 import org.apache.logging.log4j.core.appender.db.nosql.NoSQLObject;
-import org.apache.logging.log4j.status.StatusLogger;
 
 import com.mongodb.BasicDBObject;
 import com.mongodb.DB;
@@ -33,8 +32,6 @@ import com.mongodb.WriteResult;
  * The MongoDB implementation of {@link NoSQLConnection}.
  */
 public final class MongoDBConnection implements NoSQLConnection<BasicDBObject, MongoDBObject> {
-    private static final Logger LOGGER = StatusLogger.getLogger();
-
     private final DBCollection collection;
     private final Mongo mongo;
     private final WriteConcern writeConcern;
@@ -59,11 +56,17 @@ public final class MongoDBConnection imp
     public void insertObject(final NoSQLObject<BasicDBObject> object) {
         try {
             final WriteResult result = this.collection.insert(object.unwrap(), this.writeConcern);
+            if (result.getError() != null && result.getError().length() > 0) {
+                throw new AppenderLoggingException("Failed to write log event to MongoDB due to error: " +
+                        result.getError() + ".");
+            }
             if (result.getN() < 1) {
-                LOGGER.error("Failed to write log event to MongoDB due to invalid result [{}].", result.getN());
+                throw new AppenderLoggingException("Failed to write log event to MongoDB. Number of records written: " +
+                        result.getN() + ".");
             }
         } catch (final MongoException e) {
-            LOGGER.error("Failed to write log event to MongoDB due to error.", e);
+            throw new AppenderLoggingException("Failed to write log event to MongoDB due to error: " + e.getMessage(),
+                    e);
         }
     }
 

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/FastRollingFileManager.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/FastRollingFileManager.java?rev=1504311&r1=1504310&r2=1504311&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/FastRollingFileManager.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/FastRollingFileManager.java Wed Jul 17 22:32:16 2013
@@ -23,7 +23,7 @@ import java.io.RandomAccessFile;
 import java.nio.ByteBuffer;
 
 import org.apache.logging.log4j.core.Layout;
-import org.apache.logging.log4j.core.appender.AppenderRuntimeException;
+import org.apache.logging.log4j.core.appender.AppenderLoggingException;
 import org.apache.logging.log4j.core.appender.ManagerFactory;
 
 /**
@@ -105,7 +105,7 @@ public class FastRollingFileManager exte
             randomAccessFile.write(buffer.array(), 0, buffer.limit());
         } catch (final IOException ex) {
             final String msg = "Error writing to RandomAccessFile " + getName();
-            throw new AppenderRuntimeException(msg, ex);
+            throw new AppenderLoggingException(msg, ex);
         }
         buffer.clear();
     }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/AppenderControl.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/AppenderControl.java?rev=1504311&r1=1504310&r2=1504311&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/AppenderControl.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/AppenderControl.java Wed Jul 17 22:32:16 2013
@@ -22,7 +22,7 @@ import org.apache.logging.log4j.Level;
 import org.apache.logging.log4j.core.Appender;
 import org.apache.logging.log4j.core.Filter;
 import org.apache.logging.log4j.core.LogEvent;
-import org.apache.logging.log4j.core.appender.AppenderRuntimeException;
+import org.apache.logging.log4j.core.appender.AppenderLoggingException;
 import org.apache.logging.log4j.core.filter.AbstractFilterable;
 import org.apache.logging.log4j.core.filter.Filterable;
 
@@ -89,7 +89,7 @@ public class AppenderControl<T extends S
                 appender.getHandler().error("Attempted to append to non-started appender " + appender.getName());
 
                 if (!appender.isExceptionSuppressed()) {
-                    throw new AppenderRuntimeException(
+                    throw new AppenderLoggingException(
                         "Attempted to append to non-started appender " + appender.getName());
                 }
             }
@@ -108,7 +108,7 @@ public class AppenderControl<T extends S
             } catch (final Exception ex) {
                 appender.getHandler().error("An exception occurred processing Appender " + appender.getName(), ex);
                 if (!appender.isExceptionSuppressed()) {
-                    throw new AppenderRuntimeException(ex);
+                    throw new AppenderLoggingException(ex);
                 }
             }
         } finally {

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationException.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationException.java?rev=1504311&r1=1504310&r2=1504311&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationException.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationException.java Wed Jul 17 22:32:16 2013
@@ -17,20 +17,29 @@
 package org.apache.logging.log4j.core.config;
 
 /**
- *
+ * This exception is thrown when an error occurs reading from, parsing, using, or initializing the Log4j 2
+ * configuration. It is also thrown if an appender cannot be created based on the configuration provided.
  */
 public class ConfigurationException extends RuntimeException {
 
-    /**
-     * Generated serial version ID.
-     */
     private static final long serialVersionUID = -2413951820300775294L;
 
-    public ConfigurationException(final String msg) {
-        super(msg);
+    /**
+     * Construct an exception with a message.
+     *
+     * @param message The reason for the exception
+     */
+    public ConfigurationException(final String message) {
+        super(message);
     }
 
-    public ConfigurationException(final String msg, final Exception ex) {
-        super(msg, ex);
+    /**
+     * Construct an exception with a message and underlying cause.
+     *
+     * @param message The reason for the exception
+     * @param cause The underlying cause of the exception
+     */
+    public ConfigurationException(final String message, final Throwable cause) {
+        super(message, cause);
     }
 }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/DatagramOutputStream.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/DatagramOutputStream.java?rev=1504311&r1=1504310&r2=1504311&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/DatagramOutputStream.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/DatagramOutputStream.java Wed Jul 17 22:32:16 2013
@@ -25,7 +25,7 @@ import java.net.SocketException;
 import java.net.UnknownHostException;
 
 import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.core.appender.AppenderRuntimeException;
+import org.apache.logging.log4j.core.appender.AppenderLoggingException;
 import org.apache.logging.log4j.status.StatusLogger;
 
 /**
@@ -65,7 +65,7 @@ public class DatagramOutputStream extend
         } catch (final UnknownHostException ex) {
             final String msg = "Could not find host " + host;
             LOGGER.error(msg, ex);
-            throw new AppenderRuntimeException(msg, ex);
+            throw new AppenderLoggingException(msg, ex);
         }
 
         try {
@@ -73,7 +73,7 @@ public class DatagramOutputStream extend
         } catch (final SocketException ex) {
             final String msg = "Could not instantiate DatagramSocket to " + host;
             LOGGER.error(msg, ex);
-            throw new AppenderRuntimeException(msg, ex);
+            throw new AppenderLoggingException(msg, ex);
         }
     }
 

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/TCPSocketManager.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/TCPSocketManager.java?rev=1504311&r1=1504310&r2=1504311&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/TCPSocketManager.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/TCPSocketManager.java Wed Jul 17 22:32:16 2013
@@ -28,7 +28,7 @@ import java.util.Map;
 import java.util.concurrent.CountDownLatch;
 
 import org.apache.logging.log4j.core.Layout;
-import org.apache.logging.log4j.core.appender.AppenderRuntimeException;
+import org.apache.logging.log4j.core.appender.AppenderLoggingException;
 import org.apache.logging.log4j.core.appender.ManagerFactory;
 import org.apache.logging.log4j.core.appender.OutputStreamManager;
 import org.apache.logging.log4j.core.helpers.Strings;
@@ -116,7 +116,7 @@ public class TCPSocketManager extends Ab
             }
             if (socket == null) {
                 final String msg = "Error writing to " + getName() + " socket not available";
-                throw new AppenderRuntimeException(msg);
+                throw new AppenderLoggingException(msg);
             }
         }
         synchronized (this) {
@@ -130,7 +130,7 @@ public class TCPSocketManager extends Ab
                     connector.start();
                 }
                 final String msg = "Error writing to " + getName();
-                throw new AppenderRuntimeException(msg, ex);
+                throw new AppenderLoggingException(msg, ex);
             }
         }
     }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseAppenderTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseAppenderTest.java?rev=1504311&r1=1504310&r2=1504311&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseAppenderTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseAppenderTest.java Wed Jul 17 22:32:16 2013
@@ -67,7 +67,7 @@ public class AbstractDatabaseAppenderTes
     }
 
     @Test
-    public void testStartAndStop() {
+    public void testStartAndStop() throws Exception {
         this.setUp("name");
 
         this.manager.connectInternal();
@@ -86,7 +86,7 @@ public class AbstractDatabaseAppenderTes
     }
 
     @Test
-    public void testReplaceManager() {
+    public void testReplaceManager() throws Exception {
         this.setUp("name");
 
         replay(this.manager, this.appender);
@@ -149,9 +149,9 @@ public class AbstractDatabaseAppenderTes
 
     private static abstract class LocalAbstractDatabaseAppender extends
             AbstractDatabaseAppender<LocalAbstractDatabaseManager> {
-        public LocalAbstractDatabaseAppender(final String name, final Filter filter, final boolean handleException,
+        public LocalAbstractDatabaseAppender(final String name, final Filter filter, final boolean exceptionSuppressed,
                                              final LocalAbstractDatabaseManager manager) {
-            super(name, filter, handleException, manager);
+            super(name, filter, exceptionSuppressed, manager);
         }
     }
 }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseManagerTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseManagerTest.java?rev=1504311&r1=1504310&r2=1504311&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseManagerTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseManagerTest.java Wed Jul 17 22:32:16 2013
@@ -40,7 +40,7 @@ public class AbstractDatabaseManagerTest
     }
 
     @Test
-    public void testConnection01() {
+    public void testConnection01() throws Exception {
         this.setUp("testName01", 0);
 
         replay(this.manager);
@@ -68,7 +68,7 @@ public class AbstractDatabaseManagerTest
     }
 
     @Test
-    public void testConnection02() {
+    public void testConnection02() throws Exception {
         this.setUp("anotherName02", 0);
 
         replay(this.manager);
@@ -114,7 +114,7 @@ public class AbstractDatabaseManagerTest
     }
 
     @Test
-    public void testBuffering01() {
+    public void testBuffering01() throws Exception {
         this.setUp("name", 0);
 
         final LogEvent event1 = createStrictMock(LogEvent.class);
@@ -149,7 +149,7 @@ public class AbstractDatabaseManagerTest
     }
 
     @Test
-    public void testBuffering02() {
+    public void testBuffering02() throws Exception {
         this.setUp("name", 4);
 
         final LogEvent event1 = createStrictMock(LogEvent.class);
@@ -183,7 +183,7 @@ public class AbstractDatabaseManagerTest
     }
 
     @Test
-    public void testBuffering03() {
+    public void testBuffering03() throws Exception {
         this.setUp("name", 10);
 
         final LogEvent event1 = createStrictMock(LogEvent.class);
@@ -214,7 +214,7 @@ public class AbstractDatabaseManagerTest
     }
 
     @Test
-    public void testBuffering04() {
+    public void testBuffering04() throws Exception {
         this.setUp("name", 10);
 
         final LogEvent event1 = createStrictMock(LogEvent.class);

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/nosql/NoSQLDatabaseManagerTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/nosql/NoSQLDatabaseManagerTest.java?rev=1504311&r1=1504310&r2=1504311&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/nosql/NoSQLDatabaseManagerTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/nosql/NoSQLDatabaseManagerTest.java Wed Jul 17 22:32:16 2013
@@ -27,6 +27,7 @@ import org.apache.logging.log4j.Level;
 import org.apache.logging.log4j.MarkerManager;
 import org.apache.logging.log4j.ThreadContext;
 import org.apache.logging.log4j.core.LogEvent;
+import org.apache.logging.log4j.core.appender.AppenderLoggingException;
 import org.apache.logging.log4j.core.appender.db.nosql.couch.CouchDBObject;
 import org.apache.logging.log4j.message.Message;
 import org.easymock.Capture;
@@ -81,7 +82,8 @@ public class NoSQLDatabaseManagerTest {
         } finally {
             try {
                 manager.release();
-            } catch (final Throwable ignore) { /* */
+            } catch (final Throwable ignore) {
+                /* */
             }
         }
     }
@@ -99,13 +101,19 @@ public class NoSQLDatabaseManagerTest {
             final LogEvent event = createStrictMock(LogEvent.class);
             replay(this.provider, this.connection, event);
 
-            manager.writeInternal(event);
+            try {
+                manager.writeInternal(event);
+                fail("Expected AppenderLoggingException.");
+            } catch (AppenderLoggingException ignore) {
+                /* */
+            }
 
             verify(event);
         } finally {
             try {
                 manager.release();
-            } catch (final Throwable ignore) { /* */
+            } catch (final Throwable ignore) {
+                /* */
             }
         }
     }
@@ -127,7 +135,12 @@ public class NoSQLDatabaseManagerTest {
             expect(this.connection.isClosed()).andReturn(true);
             replay(this.provider, this.connection, event);
 
-            manager.writeInternal(event);
+            try {
+                manager.writeInternal(event);
+                fail("Expected AppenderLoggingException.");
+            } catch (AppenderLoggingException ignore) {
+                /* */
+            }
 
             verify(this.provider, this.connection, event);
             reset(this.provider, this.connection);
@@ -138,7 +151,8 @@ public class NoSQLDatabaseManagerTest {
         } finally {
             try {
                 manager.release();
-            } catch (final Throwable ignore) { /* */
+            } catch (final Throwable ignore) {
+                /* */
             }
         }
     }
@@ -223,7 +237,8 @@ public class NoSQLDatabaseManagerTest {
         } finally {
             try {
                 manager.release();
-            } catch (final Throwable ignore) { /* */
+            } catch (final Throwable ignore) {
+                /* */
             }
         }
     }
@@ -356,7 +371,8 @@ public class NoSQLDatabaseManagerTest {
         } finally {
             try {
                 manager.release();
-            } catch (final Throwable ignore) { /* */
+            } catch (final Throwable ignore) {
+                /* */
             }
         }
     }
@@ -533,7 +549,8 @@ public class NoSQLDatabaseManagerTest {
         } finally {
             try {
                 manager.release();
-            } catch (final Throwable ignore) { /* */
+            } catch (final Throwable ignore) {
+                /* */
             }
         }
     }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/AbstractSocketServerTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/AbstractSocketServerTest.java?rev=1504311&r1=1504310&r2=1504311&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/AbstractSocketServerTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/AbstractSocketServerTest.java Wed Jul 17 22:32:16 2013
@@ -16,6 +16,12 @@
  */
 package org.apache.logging.log4j.core.net;
 
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
 import org.apache.logging.log4j.Level;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.core.Appender;
@@ -23,7 +29,7 @@ import org.apache.logging.log4j.core.Fil
 import org.apache.logging.log4j.core.LogEvent;
 import org.apache.logging.log4j.core.Logger;
 import org.apache.logging.log4j.core.LoggerContext;
-import org.apache.logging.log4j.core.appender.AppenderRuntimeException;
+import org.apache.logging.log4j.core.appender.AppenderLoggingException;
 import org.apache.logging.log4j.core.appender.ConsoleAppender;
 import org.apache.logging.log4j.core.appender.SocketAppender;
 import org.apache.logging.log4j.core.filter.AbstractFilter;
@@ -32,14 +38,7 @@ import org.apache.logging.log4j.test.app
 import org.junit.After;
 import org.junit.Test;
 
-import java.io.IOException;
-import java.io.Serializable;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.*;
 
 /**
  *
@@ -95,7 +94,7 @@ public abstract class AbstractSocketServ
             try {
                 testServer(m1, m2);
 
-            } catch (final AppenderRuntimeException are) {
+            } catch (final AppenderLoggingException are) {
                 assertTrue("", are.getCause() != null && are.getCause() instanceof IOException);
                 // Failure expected.
             }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/SocketMessageLossTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/SocketMessageLossTest.java?rev=1504311&r1=1504310&r2=1504311&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/SocketMessageLossTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/SocketMessageLossTest.java Wed Jul 17 22:32:16 2013
@@ -16,13 +16,6 @@
  */
 package org.apache.logging.log4j.core.net;
 
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.core.appender.AppenderRuntimeException;
-import org.apache.logging.log4j.core.config.XMLConfigurationFactory;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
 import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.InputStream;
@@ -34,6 +27,13 @@ import java.util.concurrent.ExecutorServ
 import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
 
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.core.appender.AppenderLoggingException;
+import org.apache.logging.log4j.core.config.XMLConfigurationFactory;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
 import static org.junit.Assert.*;
 
 public class SocketMessageLossTest {
@@ -78,7 +78,7 @@ public class SocketMessageLossTest {
             try {
                 logger.error(message);
                 fail("Expected exception not thrown");
-            } catch (final AppenderRuntimeException e) {
+            } catch (final AppenderLoggingException e) {
                 // An exception is expected.
             }
 
@@ -86,7 +86,7 @@ public class SocketMessageLossTest {
             try {
                 logger.error(message);
                 fail("Expected exception not thrown");
-            } catch (final AppenderRuntimeException e) {
+            } catch (final AppenderLoggingException e) {
                 // An exception is expected.
             }
         } finally {

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/SocketReconnectTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/SocketReconnectTest.java?rev=1504311&r1=1504310&r2=1504311&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/SocketReconnectTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/SocketReconnectTest.java Wed Jul 17 22:32:16 2013
@@ -16,20 +16,21 @@
  */
 package org.apache.logging.log4j.core.net;
 
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.util.ArrayList;
+import java.util.List;
+
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.core.appender.AppenderRuntimeException;
+import org.apache.logging.log4j.core.appender.AppenderLoggingException;
 import org.apache.logging.log4j.core.config.XMLConfigurationFactory;
 import org.apache.logging.log4j.core.helpers.Constants;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-import java.net.ServerSocket;
-import java.net.Socket;
-import java.util.ArrayList;
-import java.util.List;
 import static org.junit.Assert.*;
 
 public class SocketReconnectTest {
@@ -90,7 +91,7 @@ public class SocketReconnectTest {
         for (int i = 0; i < 100; ++i) {
             try {
                 logger.error(message);
-            } catch (final AppenderRuntimeException e) {
+            } catch (final AppenderLoggingException e) {
                 exceptionCaught = true;
                 break;
                 // System.err.println("Caught expected exception");

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/SocketTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/SocketTest.java?rev=1504311&r1=1504310&r2=1504311&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/SocketTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/SocketTest.java Wed Jul 17 22:32:16 2013
@@ -16,13 +16,6 @@
  */
 package org.apache.logging.log4j.core.net;
 
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.core.appender.AppenderRuntimeException;
-import org.apache.logging.log4j.core.config.XMLConfigurationFactory;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.ServerSocket;
@@ -30,6 +23,13 @@ import java.net.Socket;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutorService;
 
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.core.appender.AppenderLoggingException;
+import org.apache.logging.log4j.core.config.XMLConfigurationFactory;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
 import static org.junit.Assert.fail;
 
 public class SocketTest {
@@ -56,7 +56,7 @@ public class SocketTest {
         try {
             logger.error(message);
             fail("Expected exception not thrown");
-        } catch (final AppenderRuntimeException e) {
+        } catch (final AppenderLoggingException e) {
             //System.err.println("Expected exception here, but already errored out when initializing logger");
         }
     }

Modified: logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAvroManager.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAvroManager.java?rev=1504311&r1=1504310&r2=1504311&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAvroManager.java (original)
+++ logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAvroManager.java Wed Jul 17 22:32:16 2013
@@ -21,7 +21,7 @@ import java.util.Properties;
 import org.apache.flume.Event;
 import org.apache.flume.api.RpcClient;
 import org.apache.flume.api.RpcClientFactory;
-import org.apache.logging.log4j.core.appender.AppenderRuntimeException;
+import org.apache.logging.log4j.core.appender.AppenderLoggingException;
 import org.apache.logging.log4j.core.appender.ManagerFactory;
 
 /**
@@ -146,13 +146,13 @@ public class FlumeAvroManager extends Ab
                 final String msg = "Unable to write to " + getName() + " at " + agents[current].getHost() + ":" +
                     agents[current].getPort();
                 LOGGER.warn(msg, ex);
-                throw new AppenderRuntimeException("No Flume agents are available");
+                throw new AppenderLoggingException("No Flume agents are available");
             }
         }  else {
             final String msg = "Unable to write to " + getName() + " at " + agents[current].getHost() + ":" +
                 agents[current].getPort();
             LOGGER.warn(msg);
-            throw new AppenderRuntimeException("No Flume agents are available");
+            throw new AppenderLoggingException("No Flume agents are available");
         }
     }
 
@@ -171,13 +171,13 @@ public class FlumeAvroManager extends Ab
                 final String msg = "Unable to write to " + getName() + " at " + agents[current].getHost() + ":" +
                     agents[current].getPort();
                 LOGGER.warn(msg, ex);
-                throw new AppenderRuntimeException("No Flume agents are available");
+                throw new AppenderLoggingException("No Flume agents are available");
             }
         } else {
             final String msg = "Unable to write to " + getName() + " at " + agents[current].getHost() + ":" +
                 agents[current].getPort();
             LOGGER.warn(msg);
-            throw new AppenderRuntimeException("No Flume agents are available");
+            throw new AppenderLoggingException("No Flume agents are available");
         }
     }
 



Mime
View raw message