logging-commits mailing list archives

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

URL: http://svn.apache.org/r1501491
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/mongo/MongoDBProvider.java

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/nosql/mongo/MongoDBProvider.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/nosql/mongo/MongoDBProvider.java?rev=1501491&r1=1501490&r2=1501491&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/nosql/mongo/MongoDBProvider.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/nosql/mongo/MongoDBProvider.java
Tue Jul  9 19:42:46 2013
@@ -21,6 +21,7 @@ import java.lang.reflect.Method;
 import java.util.List;
 
 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;
@@ -154,15 +155,7 @@ public final class MongoDBProvider imple
             description = "database=" + databaseName;
             try {
                 if (server != null && server.length() > 0) {
-                    int portInt = 0;
-                    if (port != null && port.length() > 0) {
-                        try {
-                            portInt = Integer.parseInt(port);
-                        } catch (final NumberFormatException ignore) {
-                            // we don't care
-                        }
-                    }
-
+                    final int portInt = AbstractAppender.parseInt(port, 0);
                     description += ", server=" + server;
                     if (portInt > 0) {
                         description += ", port=" + portInt;



Mime
View raw message