Log
How can I log the processing of a Message?
Camel provides many ways to log the fact that you are processing a message. Here is are just some a few examples:
- You can use the Log component which logs the Message content.
- You can use the Tracer which trace logs message flow.
- You can also use a Processor or Bean and log from Java code.
- You can use the
log
DSL.
Using log DSL
And in In Camel 2.2 you can use the log
DSL which allows you to use Simple language to construct a dynamic message which gets logged.
For example you can do
...
Info | ||
---|---|---|
| ||
As of Camel 2.12.4/2.13.1, if no logger name or logger instance is passed to log DSL, there 's is a Registry lookup performed to find single instance of |
...
Using log DSL from Spring
In Spring DSL its it is also easy to use log DSL as shown below:
...
By default the log name is the route id. If you want to use a different log name, you would need to configure the logName option. However if you have many log's logs and you want all of them to use the same log name, then you would need to set that logName option on all of them.
...