How can I log processing a Message?
Camel provides many ways to log processing a message. Here is just some examples:
And 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.
Which will construct a String message at runtime using the Simple language. The log message will by logged at INFO level using the route id as the log name. By default a route is named route-1, route-2 etc. But you can use the routeId("myCoolRoute") to set a route name of choice.
The log DSL have overloaded methods to set the logging level and/or name as well.
and to set a logger name
For example you can use this to log the file name being processed if you consume files.
In Spring DSL its also easy to use log DSL as shown below:
The log tag has attributes to set the message, loggingLevel and logName. For example:
Available as of Camel 2.9
You can specify a marker name in the DSL
If you would like to use this EIP Pattern then please read the Getting Started, you may also find the Architecture useful particularly the description of Endpoint and URIs. Then you could try out some of the Examples first before trying this pattern out.