[slf4j-dev] Plan for SLF4J 2.0

Gunnar Wagenknecht gunnar at wagenknecht.org
Tue Mar 9 19:48:46 CET 2010


Am 09.03.2010 14:43, schrieb Ceki Gülcü:
> So if a request needs to be marked as CONFIDENTIAL and as DATABASE, you would 
> create a new marker referencing both.
> 
>   Marker m = MarkerFactory.getMarker("COMBI");
>   m.add(MarkerFactory.getMarker("CONFIDENTIAL"));
>   m.add(MarkerFactory.getMarker("DATABASE"));
> 
>   logger.info(m, "Donald Duck withdrew 1'000 rupees");

Ouch. That's not obvious just from looking at the API. Just to give you
an idea of what I have in mind:
http://bit.ly/cOsi2W

Actually, I separated logging from tracing. I even went so far and
replace log levels with tags. A developer just adds tags. In the end you
have rules/filters configured by an administrator which decided about
the importance of a log message at runtime. The reason is that I often
found code where developers just didn't care about correct log levels
but mixed debug with info, etc.

Logging can also be very useful for business events. That's when you
need structured and rich data.

But debugging/tracing doesn't need rich data. Thus, I thought about such
a drastic split between the both and also forced such a split in the APIs.

-Gunnar

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



More information about the slf4j-dev mailing list