logging-commits mailing list archives

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

URL: http://svn.apache.org/r1501489
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/couch/CouchDBProvider.java

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/nosql/couch/CouchDBProvider.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/nosql/couch/CouchDBProvider.java?rev=1501489&r1=1501488&r2=1501489&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/nosql/couch/CouchDBProvider.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/nosql/couch/CouchDBProvider.java
Tue Jul  9 19:40:22 2013
@@ -19,6 +19,7 @@ package org.apache.logging.log4j.core.ap
 import java.lang.reflect.Method;
 
 import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.core.appender.AbstractAppender;
 import org.apache.logging.log4j.core.appender.db.nosql.NoSQLProvider;
 import org.apache.logging.log4j.core.config.plugins.Plugin;
 import org.apache.logging.log4j.core.config.plugins.PluginAttr;
@@ -137,16 +138,7 @@ public final class CouchDBProvider imple
                 LOGGER.warn("No protocol specified, using default port [http].");
             }
 
-            int portInt = protocol.equals("https") ? HTTPS : HTTP;
-            if (port != null && port.length() > 0) {
-                try {
-                    portInt = Integer.parseInt(port);
-                } catch (final NumberFormatException ignore) {
-                    // we don't care
-                }
-            } else {
-                LOGGER.warn("No port specified, using default port [{}] for protocol [{}].",
portInt, protocol);
-            }
+            final int portInt = AbstractAppender.parseInt(port, protocol.equals("https")
? HTTPS : HTTP);
 
             if (Strings.isEmpty(server)) {
                 server = "localhost";



Mime
View raw message