[slf4j-dev] Plan for SLF4J 2.0

Gunnar Wagenknecht gunnar at wagenknecht.org
Mon Mar 8 22:38:32 CET 2010


Am 06.03.2010 18:13, schrieb Ceki Gülcü:
> If you are used to log4j's NDC, having NDC in SLF4J is more comfortable
> than not having it. Otherwise, since MDC is semantically richer than
> NDC (one can trivially implement NDC over MDC), one can always get by
> using MDC instead of NDC. Another reason was that by scrapping NDC in
> SLF4J there was one less piece of code to maintain.

This might be a dump question. What does an NDC gives you that and MDC
doesn't? AFAIK it's also important to keep the API for user simple and
small. Especially multiple options should be avoided.

FWIW, I'd like to see an evolution to the Marker concept in a 2.0
version. I sometimes have the feeling that the current implementation is
a bit over-engineered. Especially the difference around attached and
detached markers and their intention can be confusing for clients. For
example, sometimes they might share markers through static variables.
Suddenly sombody elses attaches another marker to such a marker and all
other log messages are polluted as well. This has some hidden
implications which I /personally/ don't like in APIs.

Frankly, I'd rather like to see a much smaller implementation. I often
compare Markers with "tags". Everything is "tagged" these days. Thus,
everything a marker needs is a good "#toString" method. :) Of course,
then there needs to be some API to accept multiple "tags" per log message.

-Gunnar

-- 
Gunnar Wagenknecht
gunnar at wagenknecht.org
http://wagenknecht.org/



More information about the slf4j-dev mailing list