Logger logger = LoggerFactory.getLogger(MyAppWithConfigFile.class);
LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
try {
JoranConfigurator configurator = new JoranConfigurator();
lc.shutdownAndReset();
configurator.setContext(lc);
configurator.doConfigure(args[0]);
} catch (JoranException je) {
StatusPrinter.print(lc.getStatusManager());
}