JoranConfigurator configurator = new JoranConfigurator();
configurator.setContext(loggerContext);
// Call context.reset() to clear any previous configuration, e.g. default
// configuration. For multi-step configuration, omit calling context.reset().
loggerContext.reset();
configurator.doConfigure(logfile);
} catch (JoranException je) {
// StatusPrinter will handle this
}
StatusPrinter.printInCaseOfErrorsOrWarnings(loggerContext);
}