logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1501485 - /logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/JPAAppender.java
Date Tue, 09 Jul 2013 19:34:54 GMT
Author: ggregory
Date: Tue Jul  9 19:34:53 2013
New Revision: 1501485

URL: http://svn.apache.org/r1501485
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/jpa/JPAAppender.java

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=1501485&r1=1501484&r2=1501485&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
Tue Jul  9 19:34:53 2013
@@ -20,6 +20,7 @@ import java.lang.reflect.Constructor;
 
 import org.apache.logging.log4j.core.Filter;
 import org.apache.logging.log4j.core.LogEvent;
+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;
@@ -75,14 +76,7 @@ public final class JPAAppender extends A
             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;
-        }
-
+        int bufferSizeInt = AbstractAppender.parseInt(bufferSize, 0);
         final boolean handleExceptions = !Boolean.parseBoolean(suppressExceptions);
 
         try {



Mime
View raw message