logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgo...@apache.org
Subject svn commit: r1400254 - in /logging/log4j/log4j2/trunk: core/src/main/java/org/apache/logging/log4j/core/appender/ core/src/test/java/org/apache/logging/log4j/core/appender/ flume-ng/src/site/xdoc/ src/changes/
Date Fri, 19 Oct 2012 19:49:44 GMT
Author: rgoers
Date: Fri Oct 19 19:49:44 2012
New Revision: 1400254

URL: http://svn.apache.org/viewvc?rev=1400254&view=rev
Log:
LOG4J2-101 - A NullPointerException would occur if no format value was passed to the SyslogAppender.

Modified:
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/SyslogAppender.java
    logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/SyslogAppenderTest.java
    logging/log4j/log4j2/trunk/flume-ng/src/site/xdoc/index.xml
    logging/log4j/log4j2/trunk/src/changes/changes.xml

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=1400254&r1=1400253&r2=1400254&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
Fri Oct 19 19:49:44 2012
@@ -111,7 +111,7 @@ public class SyslogAppender extends Sock
                 LOGGER.error("Charset " + charset + " is not supported for layout, using
" + c.displayName());
             }
         }
-        Layout layout = (format.equalsIgnoreCase(RFC5424)) ?
+        Layout layout = (RFC5424.equalsIgnoreCase(format)) ?
             RFC5424Layout.createLayout(facility, id, ein, includeMDC, mdcId, includeNL, appName,
 msgId,
                 excludes, includes, required, charset, config) :
             SyslogLayout.createLayout(facility, includeNL, charset);

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/SyslogAppenderTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/SyslogAppenderTest.java?rev=1400254&r1=1400253&r2=1400254&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/SyslogAppenderTest.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/SyslogAppenderTest.java
Fri Oct 19 19:49:44 2012
@@ -121,6 +121,29 @@ public class SyslogAppenderTest {
 
 
     @Test
+    public void testDefaultAppender() throws Exception {
+        SyslogAppender appender = createAppender("tcp", null);
+        appender.start();
+
+        // set appender on root and set level to debug
+        root.addAppender(appender);
+        root.setAdditive(false);
+        root.setLevel(Level.DEBUG);
+        root.debug("This is a test message");
+        String msg = list.poll(3, TimeUnit.SECONDS);
+        assertNotNull("No event retrieved", msg);
+        assertTrue("Incorrect msg: " + msg, msg.endsWith("This is a test message\n"));
+        assertTrue("Message not delivered via TCP", tcpCount > 0);
+        root.debug("This is test message 2");
+        msg = list.poll(3, TimeUnit.SECONDS);
+        assertNotNull("No event retrieved", msg);
+        assertTrue("Incorrect msg: " + msg, msg.endsWith("This is test message 2\n"));
+        assertTrue("Message not delivered via TCP", tcpCount > 1);
+    }
+
+
+
+    @Test
     public void testTCPStructuredAppender() throws Exception {
         SyslogAppender appender = createAppender("tcp", "RFC5424");
         appender.start();

Modified: logging/log4j/log4j2/trunk/flume-ng/src/site/xdoc/index.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/flume-ng/src/site/xdoc/index.xml?rev=1400254&r1=1400253&r2=1400254&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/flume-ng/src/site/xdoc/index.xml (original)
+++ logging/log4j/log4j2/trunk/flume-ng/src/site/xdoc/index.xml Fri Oct 19 19:49:44 2012
@@ -30,7 +30,8 @@
             </p>
           <subsection name="Remote Agent">
             <p>
-
+              Including the Log4j flume-ng jar in your Maven-based project as a dependency
should cause all the
+              transitive dependencies necessary for the remote Agent to function to be included.
             </p>
           </subsection>
 

Modified: logging/log4j/log4j2/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/src/changes/changes.xml?rev=1400254&r1=1400253&r2=1400254&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/src/changes/changes.xml (original)
+++ logging/log4j/log4j2/trunk/src/changes/changes.xml Fri Oct 19 19:49:44 2012
@@ -23,6 +23,9 @@
 
   <body>
     <release version="2.0-beta3" date="TBD" description= "Bug fixes and enhancements">
+      <action issue="LOG4J2-101" dev="rgoers" type="fix" due-to="Emanuele Colombo">
+        A NullPointerException would occur if no format value was passed to the SyslogAppender.
+      </action>
       <action issue="LOG4J2-99" dev="rgoers" type="fix" due-to="Das Archive">
         MapRewritePolicy had an extra call to putAll that caused updates to behave like adds.
       </action>



Mime
View raw message