Debugging using logging
Camel includes a Log Component that is useful for debug logging in that it makes it easy to log most, or all of the contents of the messages flowing through your routes. Typically this component is only used temporarily within your routes to help you debug, and is expected to be removed before deployment. The Enabling step-by-step tracing in code recipe will cover how you can enable a similar level of logging at runtime. To log significant events within your routes, see the Log EIP (the Logging meaningful steps within your route recipe).
This recipe will show you how to use the Log Component to help debug your integrations.
Getting ready
The Java code for this recipe is located in the org.camelcookbook.monitoring.log
package. The Spring XML files are located under src/main/resources/META-INF/spring
and prefixed with log
.
How to do it...
The format for the Log Component URI is as follows:
log:<log name>[?<query options>]
In the XML DSL, this is written as:
<...