Repository: logging-log4j2
Updated Branches:
  refs/heads/master cb3d35e57 -> 85aed0c35


New SocketAppender factory API is now type safe.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/85aed0c3
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/85aed0c3
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/85aed0c3

Branch: refs/heads/master
Commit: 85aed0c35fbddd0fae64d9d1aabfceb6fe8eaa90
Parents: cb3d35e
Author: ggregory <ggreg...@apache.org>
Authored: Wed Dec 2 16:29:05 2015 -0800
Committer: ggregory <ggreg...@apache.org>
Committed: Wed Dec 2 16:29:05 2015 -0800

----------------------------------------------------------------------
 .../logging/log4j/core/appender/SocketAppender.java      | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/85aed0c3/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SocketAppender.java
----------------------------------------------------------------------
diff --git 
a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SocketAppender.java
 
b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SocketAppender.java
index cda19e4..4212613 100644
--- 
a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SocketAppender.java
+++ 
b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SocketAppender.java
@@ -201,8 +201,15 @@ public class SocketAppender extends 
AbstractOutputStreamAppender<AbstractSocketM
             @PluginAttribute("advertise") final String advertise, 
             @PluginConfiguration final Configuration config) {
             // @formatter:on
-        return createAppender(host, portNum, protocolIn, sslConfig, 
connectTimeoutMillis, delayMillis, immediateFail,
-                name, immediateFlush, ignore, layout, filter, advertise, 
config);
+        boolean isFlush = Booleans.parseBoolean(immediateFlush, true);
+        final boolean isAdvertise = Boolean.parseBoolean(advertise);
+        final boolean ignoreExceptions = Booleans.parseBoolean(ignore, true);
+        final boolean fail = Booleans.parseBoolean(immediateFail, true);
+        final int reconnectDelayMillis = 
AbstractAppender.parseInt(delayMillis, 0);
+        final int port = AbstractAppender.parseInt(portNum, 0);
+        final Protocol p = protocolIn == null ? Protocol.UDP : 
Protocol.valueOf(protocolIn);
+        return createAppender(host, port, p, sslConfig, connectTimeoutMillis, 
reconnectDelayMillis, fail, name, isFlush,
+                ignoreExceptions, layout, filter, isAdvertise, config);
     }
 
     /**

Reply via email to