camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From damianharvey <Damian.har...@aon.com.au>
Subject Camel log() and log4j MDC
Date Fri, 10 Dec 2010 04:30:06 GMT

Log4j has a nice feature where you can throw variables into the MDC static
class and refer to them in the ConversionPattern in your log4j.properties.

I am using this to store an AuditId that I take from a SOAP header. Ideally
I'd like all log messages to be printed out with this AuditId however only
the code called from the Thread that receives the SOAP message has access to
this variable. As soon as the Camel Route is started then a different thread
runs and it has no access to this variable.

Is it possible to somehow pass the MDC into the Camel thread? My hack so far
is to pass the AuditId into the route as a Header and set the MDC again.

Thanks,

Damian.
-- 
View this message in context: http://camel.465427.n5.nabble.com/Camel-log-and-log4j-MDC-tp3299813p3299813.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message