logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgo...@apache.org
Subject svn commit: r1501648 - /logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeEvent.java
Date Wed, 10 Jul 2013 05:34:37 GMT
Author: rgoers
Date: Wed Jul 10 05:34:37 2013
New Revision: 1501648

URL: http://svn.apache.org/r1501648
Log:
Include mdcPrefix on mdc key names for layout

Modified:
    logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeEvent.java

Modified: logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeEvent.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeEvent.java?rev=1501648&r1=1501647&r2=1501648&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeEvent.java
(original)
+++ logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeEvent.java
Wed Jul 10 05:34:37 2013
@@ -47,7 +47,7 @@ public class FlumeEvent extends SimpleEv
      */
     private static final long serialVersionUID = -8988674608627854140L;
 
-    private static final String DEFAULT_MDC_PREFIX = "mdc:";
+    private static final String DEFAULT_MDC_PREFIX = "";
 
     private static final String DEFAULT_EVENT_PREFIX = "";
 
@@ -156,11 +156,15 @@ public class FlumeEvent extends SimpleEv
 
     protected void addContextData(final String prefix, final Map<String, String> fields,
                                   final Map<String, String> context) {
+        Map<String, String> map = new HashMap<String, String>();
         for (final Map.Entry<String, String> entry : context.entrySet()) {
             if (entry.getKey() != null && entry.getValue() != null) {
                 fields.put(prefix + entry.getKey(), entry.getValue());
+                map.put(prefix + entry.getKey(), entry.getValue());
             }
         }
+        context.clear();
+        context.putAll(map);
     }
 
     /**



Mime
View raw message