}
public void testProgConfig() throws Exception {
String className = System.getProperty(Monolog.MONOLOG_CLASS_NAME, Monolog.JDK_WRAPPER_CLASS_NAME);
Monolog.monologFactory = Monolog.getDefaultMonologFactory();
MonologFactory mf = Monolog.instanciateMonologFactory(className);
TopicalLogger l = (TopicalLogger) mf.getLogger(
"org.objectweb.util.monolog.TestHandlerLevel.testA");
l.setIntLevel(BasicLevel.DEBUG);
l.setAdditivity(false);
Handler h1 = mf.createHandler("h1", "console");
h1.setAttribute(Handler.OUTPUT_ATTRIBUTE, "System.out");
h1.setAttribute(Handler.LEVEL_ATTRIBUTE, "WARN");
h1.setAttribute(Handler.PATTERN_ATTRIBUTE, "first handler: %m");
h1.setAttribute("activation",mf);
l.addHandler(h1);
Handler h2 = mf.createHandler("h2", "console");
h2.setAttribute(Handler.OUTPUT_ATTRIBUTE, "System.out");
h2.setAttribute(Handler.PATTERN_ATTRIBUTE, "second handler: %m");
h2.setAttribute("activation",mf);
l.addHandler(h2);
l = (TopicalLogger) mf.getLogger(
"org.objectweb.util.monolog.TestHandlerLevel.testA.l1");
l.log(BasicLevel.DEBUG, "(" + className + ") this message must be printed only one time");
}