logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nickwilli...@apache.org
Subject svn commit: r1504312 - /logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseAppender.java
Date Wed, 17 Jul 2013 22:33:55 GMT
Author: nickwilliams
Date: Wed Jul 17 22:33:55 2013
New Revision: 1504312

URL: http://svn.apache.org/r1504312
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.

Modified:
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseAppender.java

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=1504312&r1=1504311&r2=1504312&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:33:55 2013
@@ -20,6 +20,7 @@ import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReadWriteLock;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 
+import org.apache.logging.log4j.LoggingException;
 import org.apache.logging.log4j.core.Filter;
 import org.apache.logging.log4j.core.Layout;
 import org.apache.logging.log4j.core.LogEvent;
@@ -99,16 +100,14 @@ public abstract class AbstractDatabaseAp
         this.readLock.lock();
         try {
             this.getManager().write(event);
-        } catch (final RuntimeException e) {
+        } catch (final LoggingException e) {
             LOGGER.error("Unable to write to database [{}] for appender [{}].", this.getManager().getName(),
                     this.getName(), e);
-            if(!this.isExceptionSuppressed())
-                throw e;
+            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);
+            throw new AppenderLoggingException("Unable to write to database in appender:
" + e.getMessage(), e);
         } finally {
             this.readLock.unlock();
         }



Mime
View raw message