[slf4j-user] reduced flexibility comparing to older logging APIs?

Andris Rauda andris.rauda at substance.org.lv
Thu Mar 19 19:38:58 CET 2009


Hello everyone!
I've only previously used commons-logging and Log4j, and I've always kept in
mind, that they both declare Logger's (or Log's) debug(), info(), etc.
methods with Object arguments.
Of course, most common usage of logging is to write String messages, but it
totally makes sense, that you are able to log whatever you want and let the
configuration decide what to do with it.

This allows, for example, to build some auditing or monitoring systems and
benefit from common and well-known configuration and LogEvent filtering
mechanisms.

The question is, why SLF4J API throws away all this flexibility by allowing
Logger to log only String messages in a strictly defined format? Even the
MDC, which I suppose might be implemented as some sort of Map, allows only
String values for some reason.
This also means that jcl-over-slf4j will work if and only if you work with
Strings in all your appenders.

I hope someone can explain this to me. And even then, I believe this should
be one of the first things to cover in documentation?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://qos.ch/pipermail/slf4j-user/attachments/20090319/44d1a18c/attachment.htm>


More information about the slf4j-user mailing list