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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.