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

Skyworth TTG