logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ceki <c...@qos.ch>
Subject Re: org.apache.log4j.MDC vs. org.slf4j.MDC
Date Wed, 02 Nov 2011 16:45:18 GMT
On 02.11.2011 04:04, Steve Cohen wrote:

 > But why was the ability to store non-Strings [in MDC] removed
 > between log4j and slf4j in the first place?

Since java Strings are immutable, once inserted into the MDC, values
cannot be changed (voluntarily or otherwise). This makes SLF4J-style
MDC more predictable and less error prone. Of course, SLF4J's the
stricter MDC interface allows less flexibility.

To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org

View raw message