Since we're on a major migration process of this website, some component documents here are out of sync right now. In the meantime you may want to look at the asciidoc in the repository: https://github.com/apache/camel/blob/master/README.md https://github.com/apache/camel/blob/master/components/readme.adoc
MDC loggingAvailable as of Camel 2.7 From Camel 2.7: Camel uses the SLF4J logging framework. This allows Camel to support MDC logging. For more information about about MDC logging see the logback manual. The logging framework in use must support MDC. The following frameworks support MDC: See the logging framework's documentation for how to configure it to use MDC. Enabling MDC Logging in CamelTo enable MDC logging using Java: To enable MDC logging using Spring XML set CamelContext's MDC InformationCamel provides the following context information available for MDC: Before Camel 2.10:
From Camel 2.10:
The keys are subject to change as we want to align and leverage MDC across other Apache products such as ActiveMQ, ServiceMix and Karaf. Example Using LOG4JIf you use log4j you can configure MDC in the Camel will log on startup if MDC is enabled or not The follow snippet is from an unit test which shows MDC in use. Note that the exchange id and route id are displayed in their separate columns in the log file: Enabling Breadcrumb SupportFrom Camel 2.8: As the breadcrumb id is stored in a header it will persist across any transport that supports the use of headers, for example the HTTP and JMS transports. Disabling Breadcrumb SupportJava DSL: XML DSL: |