-
Notifications
You must be signed in to change notification settings - Fork 309
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(utils): Add
runBlocking
that preserves Log4j's MDC context
As `kotlinx.coroutines.runBlocking` creates a new coroutine context, it does not preserve Log4j's MDC context [1] which is stored in a thread-local `ThreadContext`. Add a helper function as replacement for `runBlocking` which always adds a `CoroutineThreadContext` which is initialized from the current `ThreadContext` to the newly created coroutine context. Signed-off-by: Martin Nonnenmacher <martin.nonnenmacher@bosch.com>
- Loading branch information
1 parent
f75bc26
commit d4d17d0
Showing
3 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters