slf4j
slf4j copied to clipboard
Introduces MDC.putAllCloseable
This feature offers the same functionality as MDC.putCloseable
but for
multiple values. And tries to follow the put
/putAll
signatures one can
see on a Map
. This would be extremely useful for structured logging when
the appender is configured to use MDC values.
The MDCCloseable
class has been modified in such a way that if a single
value is used the consumed memory profile remains the same.
This change is similar to what has been done when MDC.putCloseable
has been introduced 5c76844e4cd56292f46cabb3f0cfcc39f50253a2. I'm targetting branch 1.7-maintainance, but I'll be happy to port it to other branches e.g. master or 2.0 if that's necessary.
Any chances for merging this?
Please merge, this is useful.
For reference, I moved my code to use logstash/logstash-logback-encoder instead as it offers very good json logging in combination with the encoder's StructuredArguments
typed API to preserve type in the log event json document (numbers are serialized as numbers not as String).