logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1501483 - /logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/JDBCAppender.java
Date Tue, 09 Jul 2013 19:32:08 GMT
Author: ggregory
Date: Tue Jul  9 19:32:08 2013
New Revision: 1501483

URL: http://svn.apache.org/r1501483
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/jdbc/JDBCAppender.java

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=1501483&r1=1501482&r2=1501483&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
Tue Jul  9 19:32:08 2013
@@ -17,6 +17,7 @@
 package org.apache.logging.log4j.core.appender.db.jdbc;
 
 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;
@@ -72,14 +73,8 @@ public final class JDBCAppender extends 
                                               @PluginAttr("bufferSize") final String bufferSize,
                                               @PluginAttr("tableName") final String tableName,
                                               @PluginElement("columnConfigs") final ColumnConfig[]
columnConfigs) {
-        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 = suppressExceptions == null || !Boolean.parseBoolean(suppressExceptions);
 
         final StringBuilder managerName = new StringBuilder("jdbcManager{ description=").append(name)



Mime
View raw message