Search in sources :

Example 1 with GenericConfigurator

use of ch.qos.logback.core.joran.GenericConfigurator in project logging-log4j2 by apache.

the class LoggerContextRule method apply.

@Override
public Statement apply(final Statement base, final Description description) {
    testClassName = description.getClassName();
    return new Statement() {

        @Override
        public void evaluate() throws Throwable {
            context = (LoggerContext) LoggerFactory.getILoggerFactory();
            final GenericConfigurator configurator = new JoranConfigurator();
            configurator.setContext(context);
            configurator.doConfigure(configLocation);
            base.evaluate();
        }
    };
}
Also used : Statement(org.junit.runners.model.Statement) JoranConfigurator(ch.qos.logback.classic.joran.JoranConfigurator) GenericConfigurator(ch.qos.logback.core.joran.GenericConfigurator)

Aggregations

JoranConfigurator (ch.qos.logback.classic.joran.JoranConfigurator)1 GenericConfigurator (ch.qos.logback.core.joran.GenericConfigurator)1 Statement (org.junit.runners.model.Statement)1