camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1296779 - in /camel/trunk: camel-core/src/main/java/org/apache/camel/impl/ camel-core/src/test/java/org/apache/camel/processor/async/ camel-core/src/test/resources/ components/camel-cdi/src/test/resources/ components/camel-jms/src/test/res...
Date Sun, 04 Mar 2012 10:51:25 GMT
Author: davsclaus
Date: Sun Mar  4 10:51:25 2012
New Revision: 1296779

URL: http://svn.apache.org/viewvc?rev=1296779&view=rev
Log:
CAMEL-5047: MDC logging keys has been prefixed with camel. Thanks to Lukasz for the patch.

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/MDCUnitOfWork.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/processor/async/AsyncMDCTest.java
    camel/trunk/camel-core/src/test/resources/log4j.properties
    camel/trunk/components/camel-cdi/src/test/resources/log4j.properties
    camel/trunk/components/camel-jms/src/test/resources/log4j.properties
    camel/trunk/components/camel-spring/src/test/resources/log4j.properties
    camel/trunk/components/camel-test-blueprint/src/test/resources/log4j.properties

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/MDCUnitOfWork.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/MDCUnitOfWork.java?rev=1296779&r1=1296778&r2=1296779&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/MDCUnitOfWork.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/MDCUnitOfWork.java Sun Mar
 4 10:51:25 2012
@@ -32,13 +32,13 @@ import org.slf4j.MDC;
  */
 public class MDCUnitOfWork extends DefaultUnitOfWork {
 
-    public static final String MDC_BREADCRUMB_ID = "breadcrumbId";
-    public static final String MDC_EXCHANGE_ID = "exchangeId";
-    public static final String MDC_MESSAGE_ID = "messageId";
-    public static final String MDC_CORRELATION_ID = "correlationId";
-    public static final String MDC_ROUTE_ID = "routeId";
-    public static final String MDC_CAMEL_CONTEXT_ID = "camelContextId";
-    public static final String MDC_TRANSACTION_KEY = "transactionKey";
+    public static final String MDC_BREADCRUMB_ID = "camel.breadcrumbId";
+    public static final String MDC_EXCHANGE_ID = "camel.exchangeId";
+    public static final String MDC_MESSAGE_ID = "camel.messageId";
+    public static final String MDC_CORRELATION_ID = "camel.correlationId";
+    public static final String MDC_ROUTE_ID = "camel.routeId";
+    public static final String MDC_CAMEL_CONTEXT_ID = "camel.contextId";
+    public static final String MDC_TRANSACTION_KEY = "camel.transactionKey";
 
     private static final Logger LOG = LoggerFactory.getLogger(MDCUnitOfWork.class);
 

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/async/AsyncMDCTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/async/AsyncMDCTest.java?rev=1296779&r1=1296778&r2=1296779&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/async/AsyncMDCTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/processor/async/AsyncMDCTest.java
Sun Mar  4 10:51:25 2012
@@ -16,6 +16,12 @@
  */
 package org.apache.camel.processor.async;
 
+import static org.apache.camel.impl.MDCUnitOfWork.MDC_BREADCRUMB_ID;
+import static org.apache.camel.impl.MDCUnitOfWork.MDC_CAMEL_CONTEXT_ID;
+import static org.apache.camel.impl.MDCUnitOfWork.MDC_CORRELATION_ID;
+import static org.apache.camel.impl.MDCUnitOfWork.MDC_EXCHANGE_ID;
+import static org.apache.camel.impl.MDCUnitOfWork.MDC_ROUTE_ID;
+
 import org.apache.camel.ContextTestSupport;
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
@@ -66,8 +72,10 @@ public class AsyncMDCTest extends Contex
                 from("direct:a").routeId("route-a")
                         .process(new Processor() {
                             public void process(Exchange exchange) throws Exception {
-                                assertEquals("route-a", MDC.get("routeId"));
-                                assertEquals(exchange.getExchangeId(), MDC.get("exchangeId"));
+                                assertEquals("route-a", MDC.get(MDC_ROUTE_ID));
+                                assertEquals(exchange.getExchangeId(), MDC.get(MDC_EXCHANGE_ID));
+                                assertEquals(exchange.getContext().getName(), MDC.get(MDC_CAMEL_CONTEXT_ID));
+                                assertEquals(exchange.getIn().getHeader(Exchange.BREADCRUMB_ID),
MDC.get(MDC_BREADCRUMB_ID));
                             }
                         })
                         .to("log:before")
@@ -78,8 +86,8 @@ public class AsyncMDCTest extends Contex
                 from("direct:b").routeId("route-b")
                         .process(new Processor() {
                             public void process(Exchange exchange) throws Exception {
-                                assertEquals("route-b", MDC.get("routeId"));
-                                assertEquals(exchange.getExchangeId(), MDC.get("exchangeId"));
+                                assertEquals("route-b", MDC.get(MDC_ROUTE_ID));
+                                assertEquals(exchange.getExchangeId(), MDC.get(MDC_EXCHANGE_ID));
                             }
                         })
                         .to("log:bar").to("mock:result");

Modified: camel/trunk/camel-core/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/resources/log4j.properties?rev=1296779&r1=1296778&r2=1296779&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/resources/log4j.properties (original)
+++ camel/trunk/camel-core/src/test/resources/log4j.properties Sun Mar  4 10:51:25 2012
@@ -57,7 +57,7 @@ log4j.appender.out=org.apache.log4j.Cons
 log4j.appender.out.layout=org.apache.log4j.PatternLayout
 log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
 # MDC
-#log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %-10.10X{breadcrumbId}
- %-10.10X{exchangeId} - %-10.10X{correlationId} - %-10.10X{routeId} - %m%n
+#log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %-10.10X{camel.breadcrumbId}
- %-10.10X{camelexchangeId} - %-10.10X{camel.correlationId} - %-10.10X{camel.routeId} - %m%n
 
 # File appender
 log4j.appender.file=org.apache.log4j.FileAppender
@@ -66,6 +66,6 @@ log4j.appender.file.file=target/camel-co
 log4j.appender.file.append=true
 log4j.appender.file.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
 # MDC
-#log4j.appender.file.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %-10.10X{breadcrumbId}
- %-10.10X{exchangeId} - %-10.10X{correlationId} - %-10.10X{routeId} - %m%n
+#log4j.appender.file.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %-10.10X{camel.breadcrumbId}
- %-10.10X{camel.exchangeId} - %-10.10X{camel.correlationId} - %-10.10X{camel.routeId} - %m%n
 
 log4j.throwableRenderer=org.apache.log4j.EnhancedThrowableRenderer
\ No newline at end of file

Modified: camel/trunk/components/camel-cdi/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cdi/src/test/resources/log4j.properties?rev=1296779&r1=1296778&r2=1296779&view=diff
==============================================================================
--- camel/trunk/components/camel-cdi/src/test/resources/log4j.properties (original)
+++ camel/trunk/components/camel-cdi/src/test/resources/log4j.properties Sun Mar  4 10:51:25
2012
@@ -29,7 +29,7 @@ log4j.appender.out=org.apache.log4j.Cons
 log4j.appender.out.layout=org.apache.log4j.PatternLayout
 log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
 # MDC
-#log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %-10.10X{breadcrumbId}
- %-10.10X{exchangeId} - %-10.10X{correlationId} - %-10.10X{routeId} - %m%n
+#log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %-10.10X{camel.breadcrumbId}
- %-10.10X{camel.exchangeId} - %-10.10X{camel.correlationId} - %-10.10X{camel.routeId} - %m%n
 
 # File appender
 log4j.appender.file=org.apache.log4j.FileAppender
@@ -38,6 +38,6 @@ log4j.appender.file.file=target/camel-cd
 log4j.appender.file.append=true
 log4j.appender.file.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
 # MDC
-#log4j.appender.file.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %-10.10X{breadcrumbId}
- %-10.10X{exchangeId} - %-10.10X{correlationId} - %-10.10X{routeId} - %m%n
+#log4j.appender.file.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %-10.10X{camel.breadcrumbId}
- %-10.10X{camel.exchangeId} - %-10.10X{camel.correlationId} - %-10.10X{camel.routeId} - %m%n
 
-log4j.throwableRenderer=org.apache.log4j.EnhancedThrowableRenderer
\ No newline at end of file
+log4j.throwableRenderer=org.apache.log4j.EnhancedThrowableRenderer

Modified: camel/trunk/components/camel-jms/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/test/resources/log4j.properties?rev=1296779&r1=1296778&r2=1296779&view=diff
==============================================================================
--- camel/trunk/components/camel-jms/src/test/resources/log4j.properties (original)
+++ camel/trunk/components/camel-jms/src/test/resources/log4j.properties Sun Mar  4 10:51:25
2012
@@ -33,7 +33,7 @@ log4j.rootLogger=INFO, out
 log4j.appender.stdout=org.apache.log4j.ConsoleAppender
 log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
 log4j.appender.stdout.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
-#log4j.appender.stdout.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %-10.10X{exchangeId}
- %-10.10X{messageId} - %m%n
+#log4j.appender.stdout.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %-10.10X{camel.exchangeId}
- %-10.10X{camel.messageId} - %m%n
 
 # File appender
 log4j.appender.out=org.apache.log4j.FileAppender

Modified: camel/trunk/components/camel-spring/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/log4j.properties?rev=1296779&r1=1296778&r2=1296779&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/log4j.properties (original)
+++ camel/trunk/components/camel-spring/src/test/resources/log4j.properties Sun Mar  4 10:51:25
2012
@@ -35,7 +35,7 @@ log4j.appender.out=org.apache.log4j.Cons
 log4j.appender.out.layout=org.apache.log4j.PatternLayout
 log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
 # MDC
-#log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %-10.10X{breadcrumbId}
- %-10.10X{exchangeId} - %-10.10X{correlationId} - %-10.10X{transactionKey} - %-10.10X{routeId}
- %m%n
+#log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %-10.10X{camel.breadcrumbId}
- %-10.10X{camel.exchangeId} - %-10.10X{camel.correlationId} - %-10.10X{camel.transactionKey}
- %-10.10X{camel.routeId} - %m%n
 
 # File appender
 log4j.appender.file=org.apache.log4j.FileAppender

Modified: camel/trunk/components/camel-test-blueprint/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-test-blueprint/src/test/resources/log4j.properties?rev=1296779&r1=1296778&r2=1296779&view=diff
==============================================================================
--- camel/trunk/components/camel-test-blueprint/src/test/resources/log4j.properties (original)
+++ camel/trunk/components/camel-test-blueprint/src/test/resources/log4j.properties Sun Mar
 4 10:51:25 2012
@@ -30,7 +30,7 @@ log4j.appender.out=org.apache.log4j.Cons
 log4j.appender.out.layout=org.apache.log4j.PatternLayout
 log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
 # MDC
-#log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %-10.10X{breadcrumbId}
- %-10.10X{exchangeId} - %-10.10X{correlationId} - %-10.10X{routeId} - %m%n
+#log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %-10.10X{camel.breadcrumbId}
- %-10.10X{camel.exchangeId} - %-10.10X{camel.correlationId} - %-10.10X{camel.routeId} - %m%n
 
 # File appender
 log4j.appender.file=org.apache.log4j.FileAppender
@@ -39,4 +39,4 @@ log4j.appender.file.file=target/camel-te
 log4j.appender.file.append=true
 log4j.appender.file.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
 # MDC
-#log4j.appender.file.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %-10.10X{breadcrumbId}
- %-10.10X{exchangeId} - %-10.10X{correlationId} - %-10.10X{routeId} - %m%n
+#log4j.appender.file.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %-10.10X{camel.breadcrumbId}
- %-10.10X{camel.exchangeId} - %-10.10X{camel.correlationId} - %-10.10X{camel.routeId} - %m%n



Mime
View raw message