Having MDC in LoggingEvent for unit tests #345
tdeverdiere
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It would be handy to have the Map Diagnostic Context (MDC) in
org.slf4j.event.LoggingEvent
so it's easier to test the logs in unit tests.I use logunit which has no dependency on logback, nor log4j2. But it uses slf4j to return the results of the logs to test. So the test assertions are done on LoggingEvent.
I raise an issue in logunit : netmikey/logunit#5 , but it would be easier if LoggingEvent could have this method. This would avoid to implement a specific LogEvent class in logunit.
Beta Was this translation helpful? Give feedback.
All reactions