[logback-dev] Property for each Logger

Mirko Jahn mirkojahn at gmail.com
Mon Feb 18 15:40:33 CET 2008


Hi,

I am trying to apply a certain property (String) to a Logger in order to
later (optionally) define a Filter and Layout based on that property, but I
haven't found a (nice) way to do that with the standard API (SLF4J with
LOGBack). I was thinking about providing an extension of the Logger, but
that class is final so I am wondering how I can solve my problem without
touching LOGBack code. Maybe I am better off in the user list, but after I
wasn't sure what's the better place for that. Unfortunately, I can't use
Markers, because the property is not thread based (but ClassLoader - bundle
based). The only simple solution that crossed my mind was using a custom
syntax for my logger name, like "my.custom.property:some.FQCN". My problem
with this version is that I would change the naming convention of loggers,
which I would like to avoid if possible.

Thanks,
Mirko
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://qos.ch/pipermail/logback-dev/attachments/20080218/2507360a/attachment.htm 


More information about the logback-dev mailing list