logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgo...@apache.org
Subject svn commit: r1526807 - in /logging/log4j/log4j2/trunk: log4j-core/src/main/java/org/apache/logging/log4j/core/layout/ log4j-flume-ng/src/test/java/org/apache/logging/log4j/flume/appender/ src/changes/
Date Fri, 27 Sep 2013 06:25:57 GMT
Author: rgoers
Date: Fri Sep 27 06:25:56 2013
New Revision: 1526807

URL: http://svn.apache.org/r1526807
Log:
LOG4J2-404 - @EnterpriseNumber was missing in the ID of structured data when RFC5424Layout
is used

Modified:
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/RFC5424Layout.java
    logging/log4j/log4j2/trunk/log4j-flume-ng/src/test/java/org/apache/logging/log4j/flume/appender/FlumePersistentAppenderTest.java
    logging/log4j/log4j2/trunk/src/changes/changes.xml

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/RFC5424Layout.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/RFC5424Layout.java?rev=1526807&r1=1526806&r2=1526807&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/RFC5424Layout.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/RFC5424Layout.java
Fri Sep 27 06:25:56 2013
@@ -381,14 +381,15 @@ public class RFC5424Layout extends Abstr
             final StructuredDataMessage data = (StructuredDataMessage) message;
             final Map<String, String> map = data.getData();
             final StructuredDataId id = data.getId();
+            final String sdId = getId(id);
 
-            if (sdElements.containsKey(id.toString())) {
+            if (sdElements.containsKey(sdId)) {
                 final StructuredDataElement union = sdElements.get(id.toString());
                 union.union(map);
-                sdElements.put(id.toString(), union);
+                sdElements.put(sdId, union);
             } else {
                 final StructuredDataElement formattedData = new StructuredDataElement(map,
false);
-                sdElements.put(id.toString(), formattedData);
+                sdElements.put(sdId, formattedData);
             }
         }
 

Modified: logging/log4j/log4j2/trunk/log4j-flume-ng/src/test/java/org/apache/logging/log4j/flume/appender/FlumePersistentAppenderTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-flume-ng/src/test/java/org/apache/logging/log4j/flume/appender/FlumePersistentAppenderTest.java?rev=1526807&r1=1526806&r2=1526807&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-flume-ng/src/test/java/org/apache/logging/log4j/flume/appender/FlumePersistentAppenderTest.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-flume-ng/src/test/java/org/apache/logging/log4j/flume/appender/FlumePersistentAppenderTest.java
Fri Sep 27 06:25:56 2013
@@ -275,6 +275,19 @@ public class FlumePersistentAppenderTest
                 fields[i]);
         }
     }
+    
+    @Test
+    public void testRFC5424Layout() throws InterruptedException, IOException {
+
+        final StructuredDataMessage msg = new StructuredDataMessage("Test", "Test Log4j",
"Test");
+        EventLogger.logEvent(msg);
+
+        final Event event = primary.poll();
+        Assert.assertNotNull(event);
+        final String body = getBody(event);
+        Assert.assertTrue("Structured message does not contain @EID: " + body,
+            body.contains("Test@18060"));
+    }
 
     private class WriterThread extends Thread {
 

Modified: logging/log4j/log4j2/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/src/changes/changes.xml?rev=1526807&r1=1526806&r2=1526807&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/src/changes/changes.xml (original)
+++ logging/log4j/log4j2/trunk/src/changes/changes.xml Fri Sep 27 06:25:56 2013
@@ -21,6 +21,9 @@
   </properties>
   <body>
     <release version="2.0RC1" date="2013-MM-DD" description="Bug fixes and enhancements">
+      <action issue="LOG4J2-404" dev="rgoers" type="fix" due-to="Kamal Bahadur">
+        @EnterpriseNumber" was missing in the ID of structured data when RFC5424Layout is
used
+      </action>
       <action issue="LOG4J2-379" dev="rpopma" type="fix">
         Fixed issue that prevented Log4J from working in Google App Engine.
       </action>



Mime
View raw message