Enabling step-by-step tracing in code

Camel includes a Tracer interceptor that makes it very easy to enable step-by-step logging of the message. This interceptor will log the current state of the message, and information about the processing step within your route in which the message is located.

This recipe will show you how to enable and configure Camel's Tracer.

Getting ready

The Java code for this recipe is located in the org.camelcookbook.monitoring.trace package. The Spring XML files are located under src/main/resources/META-INF/spring and prefixed with trace.

How to do it...

In the XML DSL, set the trace attribute of the camelContext element to true:

<camelContext trace="true"
              xmlns="http://camel.apache.org/schema/spring">

In the Java DSL, fetch ...

Get Apache Camel Developer's Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.