[slf4j-user] Logger interface API

Marco Cimatti mcimatti at imolinfo.it
Fri Apr 6 10:56:19 CEST 2007


Hi there,
I work in a team and we're using SLF4J as logging system.
I've looked at the mailing list archive but I didn't find anything about 
the argument I'm going to explain: in the Logger interface, when you 
want to log a Throwable with its stack trace there is only one kind of 
method without arguments, so what you log is a (static) message and the 
exception stack trace.
I/we think the availability of another method could be an enhancement. 
Often we need to log a format with arguments and an exception, so it 
would be useful a method like:

Logger.debug/info/warn/error(String format, Object[] args, Throwable t)

These methods could be added to the Logger interface.
We've realized an implementation of these methods for JDK 1.4 loggers; 
the attachment contains the implementation.
It could be not too difficult to implement methods for others logging 
systems (log4j, jcl and so on).
Could it be an API enhancement?
Thank you in advance.
Hope to have not disturbed you.

Marco Cimatti
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: extra_JDK14LoggerAdapter.java
URL: <http://qos.ch/pipermail/slf4j-user/attachments/20070406/c4dc9e58/attachment.diff>


More information about the slf4j-user mailing list