[logback-user] How to direct calls to another API into Logback classic

Christopher BROWN brown at reflexe.fr
Tue Jun 7 22:02:04 CEST 2011


I'm using Logback classic via the SLF4J API, in a big application
where other log APIs (some standard, such as OSGI logging, and other
proprietary in-house historical APIs) are present.

I would like to re-implement these APIs to "redirect" onto Logback
classic, but to get to the point: it's a big API and I'm lost.  If I
reimplement said APIs with a naive implementation that just calls into
SLF4J or logback using the "user" API, I'll incur an extra stack frame
in stack traces and generally hide the origin of calls.

What's the best, cleanest way of doing this (given SLF4J and the
choice of logback classic) ?  I will add the Log4J API implementation
to address some cases (the SLF4J implementation of Log4J APIs) but for
the other stuff, I'm a bit stuck.


More information about the Logback-user mailing list