public void execute() { File file = settings.getPath(LoggingConf.CONFIG, confPath).toFile(); System.out.println("Configuring Logback with configuration: " + file.getAbsolutePath()); LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory(); 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(); try { configurator.doConfigure(file); // Not needed as this is the default behaviour from logback // StatusPrinter.print(loggerContext); } catch (JoranException e) { LOGGER.error(e.getMessage(), e); } StatusPrinter.printInCaseOfErrorsOrWarnings(loggerContext); } }
public void execute() { File file = settings.getPath(LoggingConf.CONFIG, confPath).toFile(); System.out.println("Configuring Logback with configuration: " + file.getAbsolutePath()); LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory(); 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(); try { configurator.doConfigure(file); // Not needed as this is the default behaviour from logback // StatusPrinter.print(loggerContext); } catch (JoranException e) { LOGGER.error(e.getMessage(), e); } StatusPrinter.printInCaseOfErrorsOrWarnings(loggerContext); } }
public static void main(String[] args) { try { LBCORE63 main = new LBCORE63(); main.start(); } catch (JoranException e) { System.out.println("Failed to load application: " + e.getMessage()); } }
} catch (JoranException e) { LOGGER.error("Error configuring logging from file {}. '{}'", loggingFile, e.getMessage(), e);
configURL, e.getMessage());
configURL, e.getMessage());
System.out.println(ex.getMessage());