Hi all,
in a asynchronous programming, different threads are used to compute different part of the program
For example: a thread A is used to initiate a GET request, and a thread B is used to handle the response.
Example:
if a thread A put a data into the MDC, the thread B cannot read it.
What could be a solution for this?
1. not using the Logback MDC, putting data in request.tags for example.
It means that the Play Logger cannot be used anymore.
Instead, we have to use a custom Logger that implements each method (info, debug,...) and add information read from the request tags for example.
-> the changes are very deep
-> the Logback MDC variables (like %X{myVariable}) cannot be used in the Logback configuration. It is quite sad, as they provide a good flexibility.
2. passing the Logback MDC from thread A to thread B.
-> change in playframework
Does somebody have another solution?
What do you think of it?
Cheers,
Yann