NOPAppender nopAppender = new NOPAppender();
nopAppender.setContext(context);
nopAppender.start();
try {
JoranConfigurator configurator = new JoranConfigurator();
configurator.setContext(context);
context.reset();
// placeholder to avoid 'No appenders present' while reconfiguring
context.getLogger(Logger.ROOT_LOGGER_NAME).addAppender(nopAppender);
// restore persisted setting so pax-logging can reload
context.putObject(PAX_BUNDLE_CONTEXT_KEY, bundleContext);
context.getStatusManager().clear();
installNonResetResistantListeners();
configurator.doConfigure(file);
}
catch (JoranException e) {
e.printStackTrace();
}