[slf4j-dev] Why no error(Throwable) on the Logger interface?

Ceki Gulcu ceki at qos.ch
Thu May 28 15:26:13 CEST 2009



Jukka Zitting wrote:
> Hi,
> 
> On Wed, May 27, 2009 at 11:41 PM, Robert Elliot <rob at lidalia.org.uk> wrote:
>> My logging implementation gives me that information if I want it.

John mentioned that he had several logging systems to contend
with. Moreover, log4j and logback can print the invoking thread's name
whereas j.u.l. will print the thread's id (an integer).

> Then why are you using SLF4J?
> 
> The main purpose of a logging facade like SLF4J is to cover cases
> where you don't and can't know what logging implementation or
> configuration will be used in places where your code is being
> deployed.

While in the general case on cannot be certain that thread name will
be printed, in the common case where log4j is in use, there is imho no
point in adding Thread.currentThread().getName() to the log message. I
guess that it really depends on the particular case being addressed.

Cheers,

> Jukka Zitting

-- 
Ceki Gülcü
Logback: The reliable, generic, fast and flexible logging framework for Java.
http://logback.qos.ch



More information about the slf4j-dev mailing list