[logback-user] Log4j to Logback migration, logback.xml question

Ceki Gulcu ceki at qos.ch
Tue Feb 8 08:17:04 CET 2011


Hello Fabio,

As Ralph Noted, XLogger in the slf4j-ext package shows how you could
extend the SLF4J Logger interface. One could do quite a bit of
extending via that approach. However, contrary to log4j, logback does
*not* provide support for such extensions in configuration files.
HTH,
--
Ceki

On 08.02.2011 02:12, Ralph Goers wrote:
 > In SLF4J org.slf4j.Logger is the interface applications code to.
 > SLF4J is the API.  If you want to change the interface you aren't
 > going to be able to use SLF4J.

 > The only good way to extend Logback's Logger is to use the
 > LoggerWrapper found in slf4j-ext, much as XLogger does.  If you want
 > to fully implement SLF4J's Logger interface than you essentially won't
 > be using Logback.

> Ralph
>
> On Feb 7, 2011, at 11:15 AM, Fabio Erculiani wrote:
>
>> Hi there,
>> I'm migrating my stuff from log4j to logback and I've gotten to the
>> log4j.xml ->  logback.xml porting.
>> Besides not having a .dtd makes the work quite hard, I am trying to
>> understand one thing:
>> In log4j I had<category>  supporting the class= attribute (while
>> <logger>, which would be its replacement from my understanding,
>> doesn't).
>> Is there anything similar in logback.xml?
>> I wrote a custom Logger (implementing Logger interface) and I would
>> like to tell the logger to use it instead of org.slf4j.Logger.
>>
>> Thanks a lot.
>> --
>> Fabio Erculiani
>> _______________________________________________
>> Logback-user mailing list
>> Logback-user at qos.ch
>> http://qos.ch/mailman/listinfo/logback-user
>
> _______________________________________________
> Logback-user mailing list
> Logback-user at qos.ch
> http://qos.ch/mailman/listinfo/logback-user




More information about the Logback-user mailing list