> On Mar 18, 2024, at 2:39 AM, Piotr P. Karwasz <piotr.karw...@gmail.com> wrote:
>
> Hi,
>
> Given the ongoing context data propagation in three Github
> issues/PRs/discussions (cf. [1], [2] and [3]). I think we should move
> the debate to the mailing list, which guarantees the maximal reachout.
>
> == Problem summary
>
> We have two different problems regarding context data in log files:
>
> 1. Raman and Mikko would like to bind context data to an object
> implementing the `Logger` interface or more generally to a service
> object (e.g. resource manager, DAO and variants),
Yes, I’ve seen that. Personally, I am not much of a fan of this use case as it
is pretty easy to add the data you want to a single class. That said, we
already offer a solution. Allowing a MessageFactory to be provided on a Logger
was done for exactly this reason.
For example, a User could configure a custom MessageFactory that provides an
extension of MapMessage that causes the message to include data from the class
or resource. Going to the extreme of trying to shoehorn in Context data as well
simply isn’t necessary.
> 2. Other users would like to bind context data to a processing
> pipeline, regardless of which threads it uses.
>
ScopedContext covers this use case and is the one I find far more compelling.
That is why I am adding support for passing data to Threads to my PR. I will
let you know when it is there.
Ralph