[slf4j-dev] [Bug 116] Switching the log message format to that of java.util.Formatter

bugzilla-daemon at pixie.qos.ch bugzilla-daemon at pixie.qos.ch
Sun Nov 30 20:26:54 CET 2008


http://bugzilla.slf4j.org/show_bug.cgi?id=116





--- Comment #13 from Ken Dobson <ken at magictractor.co.uk>  2008-11-30 20:26:54 ---
Ceki, you're absolutely right, I wasn't thinking beyond my application. I can't
see a way to allow an optional SLF4J configuration file to be distributed with
each library which would be consistent with SLF4J's simplicity (it can be done
with classpath trickery, but nobody wants that).

It looks like custom formatting and internationalization will require either
'tons of "isDebugEnabled"', which I also hate, or application specific logging
layers wrapping SLF4J, another bad smell I encounter too often.

The most elegant solution I've come up with so far is to create a decorator
Logger which modifies the message before passing it to a vanilla Logger
delegate. Message decoration could be added to the SLF4J API, but I'd
understand if you felt it was unnecessary clutter. This could look like:

LoggerFactory.getLogger(this.getClass(), new
JavaUtilFormatterMessageDecorator());


-- 
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the slf4j-dev mailing list