You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Michael Rambichler <mi...@rambichler.at> on 2023/01/26 18:46:26 UTC

Logging of exchangeId and breadcrumbId

Hi folks!

We are using MDC Logging to get the exchangeId, breadcrumbId attached to
all our log/debug lines pushed to our elk stack.

Currently we use MDCLogging and logstash-logback-encoder which is
configured as JSON output
I often read that MDC Logging is not that well supported/proposed in camel.

Is there a way without MDC to get the structured information like
camel.exchangeId, camel.breadcrumbId pushed to our elk?

Or do we need MDC Logging for that.

BR
 Michael

Re: Logging of exchangeId and breadcrumbId

Posted by Ephemeris Lappis <ep...@gmail.com>.
Hello.

I'm not sure this is the unique solution, but we have developed a custom 
MDCUnitOfWork to add our own information (a custom correlation ID header 
we have between applications, for example). As we use Karaf to execute 
our Camel routes, the custom factory is exposed by another bundle as an 
OSGi service, and referenced our the route blueprint, and the camel 
context gets it from the service registry.

We also have adapted the ops4j logger configuration to add the MDC 
values to the pattern.

If this solution matches your need, I can send you some java files.

Regards.

Ephemeris Lappis

Le 26/01/2023 à 19:46, Michael Rambichler a écrit :
> Hi folks!
>
> We are using MDC Logging to get the exchangeId, breadcrumbId attached to
> all our log/debug lines pushed to our elk stack.
>
> Currently we use MDCLogging and logstash-logback-encoder which is
> configured as JSON output
> I often read that MDC Logging is not that well supported/proposed in camel.
>
> Is there a way without MDC to get the structured information like
> camel.exchangeId, camel.breadcrumbId pushed to our elk?
>
> Or do we need MDC Logging for that.
>
> BR
>   Michael
>

-- 
Cet e-mail a été vérifié par le logiciel antivirus d'Avast.
www.avast.com