logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1501487 - /logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/nosql/NoSQLAppender.java
Date Tue, 09 Jul 2013 19:36:16 GMT
Author: ggregory
Date: Tue Jul  9 19:36:16 2013
New Revision: 1501487

URL: http://svn.apache.org/r1501487
Log:
Use AbstractAppender.parseInt to log parsing exceptions to AbstractAppender's logger.

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

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=1501487&r1=1501486&r2=1501487&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
Tue Jul  9 19:36:16 2013
@@ -17,6 +17,7 @@
 package org.apache.logging.log4j.core.appender.db.nosql;
 
 import org.apache.logging.log4j.core.Filter;
+import org.apache.logging.log4j.core.appender.AbstractAppender;
 import org.apache.logging.log4j.core.appender.db.AbstractDatabaseAppender;
 import org.apache.logging.log4j.core.config.plugins.Plugin;
 import org.apache.logging.log4j.core.config.plugins.PluginAttr;
@@ -74,14 +75,7 @@ public final class NoSQLAppender extends
             return null;
         }
 
-        int bufferSizeInt;
-        try {
-            bufferSizeInt = Strings.isEmpty(bufferSize) ? 0 : Integer.parseInt(bufferSize);
-        } catch (final NumberFormatException e) {
-            LOGGER.warn("Buffer size [" + bufferSize + "] not an integer, using no buffer.");
-            bufferSizeInt = 0;
-        }
-
+        final int bufferSizeInt = AbstractAppender.parseInt(bufferSize, 0);
         final boolean handleExceptions = !Boolean.parseBoolean(suppressExceptions);
 
         final String managerName = "noSqlManager{ description=" + name + ", bufferSize="
+ bufferSizeInt



Mime
View raw message