You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by Claus Ibsen <cl...@gmail.com> on 2021/03/22 09:45:37 UTC

Deprecating MDC logging

Hi

In Camel 3.x and in a more and more reactive world, then MDC logging
is becoming a more and more bad practice.

That MDC context is thread bound, and that information needs to be
transferred between MDC thread bound context when Camel routes
messages, both within its own routing engine, but also via 3rd party
libraries that uses their threading model.

All that makes MDC not possible to reliably transfer data between
threads, and also to "reset" when its done etc.

Also there is overhead associated with attempting to do this within
the Camel framework.

I would like to deprecate MDC logging in Camel 3.10 onwards.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Re: Deprecating MDC logging

Posted by Ralf Claussnitzer <ra...@slub-dresden.de>.
Hi Claus,

aren't there libraries that implement reactive context?

Reactive contexts could replace the thread contexts and hold the MDC 
instance, no?

Regards,
Ralf

On 3/22/21 10:45 AM, Claus Ibsen wrote:
> Hi
>
> In Camel 3.x and in a more and more reactive world, then MDC logging
> is becoming a more and more bad practice.
>
> That MDC context is thread bound, and that information needs to be
> transferred between MDC thread bound context when Camel routes
> messages, both within its own routing engine, but also via 3rd party
> libraries that uses their threading model.
>
> All that makes MDC not possible to reliably transfer data between
> threads, and also to "reset" when its done etc.
>
> Also there is overhead associated with attempting to do this within
> the Camel framework.
>
> I would like to deprecate MDC logging in Camel 3.10 onwards.
>
>
>

Re: Deprecating MDC logging

Posted by Pascal Schumacher <pa...@gmx.net>.
-0: We are using it a lot. It is very convenient and works great for our
use-cases.

Am 22.03.2021 um 10:45 schrieb Claus Ibsen:
> Hi
>
> In Camel 3.x and in a more and more reactive world, then MDC logging
> is becoming a more and more bad practice.
>
> That MDC context is thread bound, and that information needs to be
> transferred between MDC thread bound context when Camel routes
> messages, both within its own routing engine, but also via 3rd party
> libraries that uses their threading model.
>
> All that makes MDC not possible to reliably transfer data between
> threads, and also to "reset" when its done etc.
>
> Also there is overhead associated with attempting to do this within
> the Camel framework.
>
> I would like to deprecate MDC logging in Camel 3.10 onwards.
>
>
>


Re: Deprecating MDC logging

Posted by Jean-Baptiste Onofre <jb...@nanthrax.net>.
+0

Regards
JB

> Le 22 mars 2021 à 10:45, Claus Ibsen <cl...@gmail.com> a écrit :
> 
> Hi
> 
> In Camel 3.x and in a more and more reactive world, then MDC logging
> is becoming a more and more bad practice.
> 
> That MDC context is thread bound, and that information needs to be
> transferred between MDC thread bound context when Camel routes
> messages, both within its own routing engine, but also via 3rd party
> libraries that uses their threading model.
> 
> All that makes MDC not possible to reliably transfer data between
> threads, and also to "reset" when its done etc.
> 
> Also there is overhead associated with attempting to do this within
> the Camel framework.
> 
> I would like to deprecate MDC logging in Camel 3.10 onwards.
> 
> 
> 
> -- 
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2


Re: Deprecating MDC logging

Posted by Andrea Cosentino <an...@gmail.com>.
+1

Il lun 22 mar 2021, 10:45 Claus Ibsen <cl...@gmail.com> ha scritto:

> Hi
>
> In Camel 3.x and in a more and more reactive world, then MDC logging
> is becoming a more and more bad practice.
>
> That MDC context is thread bound, and that information needs to be
> transferred between MDC thread bound context when Camel routes
> messages, both within its own routing engine, but also via 3rd party
> libraries that uses their threading model.
>
> All that makes MDC not possible to reliably transfer data between
> threads, and also to "reset" when its done etc.
>
> Also there is overhead associated with attempting to do this within
> the Camel framework.
>
> I would like to deprecate MDC logging in Camel 3.10 onwards.
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>