logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgo...@apache.org
Subject svn commit: r1429632 - in /logging/log4j/log4j2/trunk: core/src/main/java/org/apache/logging/log4j/core/appender/SocketAppender.java core/src/main/java/org/apache/logging/log4j/core/appender/SyslogAppender.java src/changes/changes.xml
Date Mon, 07 Jan 2013 00:49:29 GMT
Author: rgoers
Date: Mon Jan  7 00:49:28 2013
New Revision: 1429632

URL: http://svn.apache.org/viewvc?rev=1429632&view=rev
Log:
LOG4J2-139 - Fix null pointer exception in SocketAppender if no protocol is specified. The
protocol will default to TCP for the SocketAppender and UDP for the SyslogAppender.

Modified:
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/SocketAppender.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/SyslogAppender.java
    logging/log4j/log4j2/trunk/src/changes/changes.xml

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/SocketAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/SocketAppender.java?rev=1429632&r1=1429631&r2=1429632&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/SocketAppender.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/SocketAppender.java
Mon Jan  7 00:49:28 2013
@@ -80,7 +80,9 @@ public class SocketAppender extends Abst
             return null;
         }
 
-        final AbstractSocketManager manager = createSocketManager(protocol, host, port, reconnectDelay);
+        final String prot = protocol != null ? protocol : Protocol.TCP.name();
+
+        final AbstractSocketManager manager = createSocketManager(prot, host, port, reconnectDelay);
         if (manager == null) {
             return null;
         }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/SyslogAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/SyslogAppender.java?rev=1429632&r1=1429631&r2=1429632&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/SyslogAppender.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/SyslogAppender.java
Mon Jan  7 00:49:28 2013
@@ -27,6 +27,7 @@ import org.apache.logging.log4j.core.con
 import org.apache.logging.log4j.core.layout.RFC5424Layout;
 import org.apache.logging.log4j.core.layout.SyslogLayout;
 import org.apache.logging.log4j.core.net.AbstractSocketManager;
+import org.apache.logging.log4j.core.net.Protocol;
 
 import java.nio.charset.Charset;
 
@@ -122,7 +123,8 @@ public class SyslogAppender extends Sock
             LOGGER.error("No name provided for SyslogAppender");
             return null;
         }
-        final AbstractSocketManager manager = createSocketManager(protocol, host, port, reconnectDelay);
+        final String prot = protocol != null ? protocol : Protocol.UDP.name();
+        final AbstractSocketManager manager = createSocketManager(prot, host, port, reconnectDelay);
         if (manager == null) {
             return null;
         }

Modified: logging/log4j/log4j2/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/src/changes/changes.xml?rev=1429632&r1=1429631&r2=1429632&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/src/changes/changes.xml (original)
+++ logging/log4j/log4j2/trunk/src/changes/changes.xml Mon Jan  7 00:49:28 2013
@@ -23,6 +23,10 @@
 
   <body>
     <release version="2.0-beta4" date="TBD" description="Bug fixes and enhancements">
+      <action issue="LOG4J2-139" dev="rgoers" type="fix">
+        Fix null pointer exception in SocketAppender if no protocol is specified. The protocol
will default
+        to TCP for the SocketAppender and UDP for the SyslogAppender.
+      </action>
       <action dev="rgoers" type="add">
         Added Log4j 2 to SLF4J adapter.
       </action>



Mime
View raw message