logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgo...@apache.org
Subject svn commit: r1491348 - in /logging/log4j/log4j2/trunk: core/src/main/java/org/apache/logging/log4j/core/appender/SocketAppender.java core/src/test/java/org/apache/logging/log4j/core/appender/SocketAppenderTest.java src/changes/changes.xml
Date Mon, 10 Jun 2013 06:48:10 GMT
Author: rgoers
Date: Mon Jun 10 06:48:09 2013
New Revision: 1491348

URL: http://svn.apache.org/r1491348
Log:
LOG4J2-139 - Fix NullPointerException when no protocol is specified. Regression introduced
by fix for LOG4J2-228

Modified:
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/SocketAppender.java
    logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/SocketAppenderTest.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=1491348&r1=1491347&r2=1491348&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 Jun 10 06:48:09 2013
@@ -115,8 +115,7 @@ public class SocketAppender<T extends Se
             return null;
         }
 
-        final String prot = protocol != null ? protocol : Protocol.TCP.name();
-        final Protocol p = EnglishEnums.valueOf(Protocol.class, protocol);
+        final Protocol p = EnglishEnums.valueOf(Protocol.class, protocol != null ? protocol
: Protocol.TCP.name());
         if (p.equals(Protocol.UDP)) {
             isFlush = true;
         }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/SocketAppenderTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/SocketAppenderTest.java?rev=1491348&r1=1491347&r2=1491348&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/SocketAppenderTest.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/SocketAppenderTest.java
Mon Jun 10 06:48:09 2013
@@ -122,6 +122,15 @@ public class SocketAppenderTest {
         assertTrue("Message not delivered via TCP", tcpCount > 1);
     }
 
+    @Test
+    public void testDefaultProtocol() throws Exception {
+
+        final SocketAppender appender = SocketAppender.createAppender("localhost", PORT,
null, "-1",
+            "false", "Test", null, null, null, null, null, null);
+        assertNotNull(appender);
+    }
+
+
 
     @Test
     public void testUDPAppender() throws Exception {

Modified: logging/log4j/log4j2/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/src/changes/changes.xml?rev=1491348&r1=1491347&r2=1491348&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/src/changes/changes.xml (original)
+++ logging/log4j/log4j2/trunk/src/changes/changes.xml Mon Jun 10 06:48:09 2013
@@ -23,6 +23,9 @@
   </properties>
   <body>
     <release version="2.0-beta8" date="2013-??-??" description="Bug fixes and enhancements">
+      <action issue="LOG4J2-139" dev="rgoers" type="fix">
+        Fix NullPointerException (regression due to fix for LOG4J2-228)
+      </action>
       <action issue="LOG4J2-168" dev="rgoers" type="update" due-to="Scott Severtson">
         Allow elements of the logging event to be added to the mdc structured data in RFC5424Layout.
       </action>



Mime
View raw message