[logback-user] question about migrating to logback from log4j

Richard Sand Richard.Sand at skyworthttg.com
Mon Jun 6 23:37:26 CEST 2011


Hi all,

 

I'm working with a COTS application, writing some extensions for it. The
application has a proprietary logging API. In the past, I wrote a custom
logging class wrapping log4j to bridge to the COTS application's log
capability. To totally isolate the usage of log4j in the API I created a
wrapper around a Logger with its own Hierarchy. 

 

We're now exploring replacing log4j with logback in these extensions and
I'm wondering if there is an analogous mechanism for accomplishing this
in logback.

 

Here is an example of what I'm doing with log4j. Note how I create a new
Hierarchy and then create a logger from that hierarchy with additivity
turned off. How would I do this with logback?

 

public final class AgentLogger {

    public static Hierarchy     heirarchy                 = new
Hierarchy(new RootLogger(Level.TRACE));

    private Logger              wl                        = null;

 

    /**

     * Private constructor

     * 

     * @param name

     */

    private AgentLogger (String name) {

        wl = heirarchy.getLogger(name);

        wl.setAdditivity(false);

    }

 

 

Any advice appreciated. Thanks!

 

Best regards,

Richard Sand | CEO
239 Kings Highway East | Haddonfield | New Jersey 08033 | USA
Mobile: +1 267 984 3651| Office: +1 856 795 1722| Fax: +1 856 795 1733

  <http://www.skyworthttg.com/> 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://qos.ch/pipermail/logback-user/attachments/20110606/283ee5d6/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 5422 bytes
Desc: image001.jpg
URL: <http://qos.ch/pipermail/logback-user/attachments/20110606/283ee5d6/attachment-0001.jpe>


More information about the Logback-user mailing list