camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aptesameer <>
Subject Refering exchangeId through POJO for logging
Date Thu, 01 Oct 2009 12:46:25 GMT

Hi All,

So far I have managed to keep my code as POJOs. I mean there is not a single
line of code in java that hints that camel is being used.(All configuration
sits happily in xml!)

However, it is the logging approach that is bugging me. At present the
logging that takes place through my pojo's cannot log exhange-id of the
message for which the pojo's method is being called.

I want camel-exchange id to be part of every logged statement so that I can
have proper trace of the message in one go. [e.g. grep exchangeId
I was thinking over it.. and thought probably, I have to have a simple camel
processor implementation that would set the exchange id in thread local.
Once the exchange id is in thread local, my POJo's can simply get the value
from thread local and log it along with other info.

obviously every route should have <camel:bean ref="logHelper"/> immediately
after <camel:from ref="abc">, so that exchange id would be available for
other beans.

Would be glad to know the opinion about this approach.../ some other
approach that could help me out!

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message