[slf4j-dev] Contributing MDC-aware Executors to slf4j

Robert Munteanu rombert at apache.org
Thu Apr 9 14:01:59 CEST 2020


Hi,

When working with asynchronous programming models ( Netty,
CompletableFuture, OSGi Promises ) it becomes problematic to propagate
the MDC between the worker threads.

I see such questions asked and solutions that work more or less posted,
e.g. [1], [2], [3].

I think it would be worthwhile to provide basic utilities in the slf4j
project, otherwise everyone keeps reinventing the wheel.

I have a couple of classes ( Executor, ScheduledExecutorService ) that
work well with my setup (Netty, OSGi Promises ) and would be willing to
contribute them to slf4j.

Is there interest in accepting such a contribution?

Thanks,
Robert

[1]: https://stackoverflow.com/questions/28668560/using-org-slf4j-mdc-with-netty-channels
[2]: https://stackoverflow.com/questions/49110745/how-to-retain-slf4j-mdc-logging-context-in-completablefuture
[3]: https://medium.com/asyncparadigm/logging-in-a-multithreaded-environment-and-with-completablefuture-construct-using-mdc-1c34c691cef0



More information about the slf4j-dev mailing list