On Sun, 2007-12-16 at 12:07 +0100, Bernd Bohmann wrote:
> Hello,
> 
> i think slf4j is a better alternative for logging compare to
> commons-logging. I don't like to start a slf4j vs commons-logging battle.
> 
> Just ask google.
> 
> I will change the tobago logging to slf4j.

Asking google is a very bad idea in this case. What you get is the
average opinion. And the *average* coder out there is a fool. Even sites
by people claiming to be experts must be treated carefully; he who
shouts loudest, and makes the boldest claims, is not always the wisest.

If you do not care about supporting localised error messages, and do not
intend to use slf4j-specific features like "markers" then the
commons-logging API is the best because it is the simplest. 

Note that we are talking about just what API myfaces code should call.
Other implementations than the one from commons can be used; for example
slf4j provides one. Whether the commons-logging implementation is good
can be debated, but there is nothing really wrong with the api - except
*possibly* for localised messages.

If you do care about supporting localised error messages, then I suggest
you keep an eye on this thread:
http://www.nabble.com/Internationalisation-of-log-messages-to14360301.html

Commons-logging deliberately does not support localisation *within* the
logging library, leaving that to the caller. But as raised in that
thread, it is not currently clear that slf4j properly supports
localisation either.

The java.util.logging api does support localisation, but it's not clear
to me that this is in practice useable. The default implementation is
crap, and there are not many alternatives because the api is horrible to
implement.

It would be better if all the myfaces projects agree on some logging
approach; otherwise an app using myfaces-core+myfaces-commons+trinidad
+tobago might need 4 different logging wrappers in the classpath.

Regards,

Simon

Reply via email to