private static void setCustomRootAppender(LoggingConfiguration conf) { Logger logger = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME); String level = StringUtils.defaultIfBlank(conf.getSubstitutionVariables().get(LoggingConfiguration.PROPERTY_ROOT_LOGGER_LEVEL), LoggingConfiguration.LEVEL_ROOT_DEFAULT); if (logger.getAppender(CUSTOM_APPENDER_NAME) == null) { logger.detachAndStopAllAppenders(); logger.addAppender(createAppender(conf.getLogOutput())); } logger.setLevel(Level.toLevel(level)); }
public static void apply(LoggingConfiguration conf, File logbackFile) { Logback.configure(logbackFile, conf.getSubstitutionVariables()); if (conf.getLogOutput() != null) { setCustomRootAppender(conf); } }
public static void apply(LoggingConfiguration conf, String classloaderPath) { Logback.configure(classloaderPath, conf.getSubstitutionVariables()); // if not set, keep default behavior (configured to stdout through the file in classpath) if (conf.getLogOutput() != null) { setCustomRootAppender(conf); } }
private static void setCustomRootAppender(LoggingConfiguration conf) { Logger logger = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME); String level = StringUtils.defaultIfBlank(conf.getSubstitutionVariables().get(LoggingConfiguration.PROPERTY_ROOT_LOGGER_LEVEL), LoggingConfiguration.LEVEL_ROOT_DEFAULT); if (logger.getAppender(CUSTOM_APPENDER_NAME) == null) { logger.detachAndStopAllAppenders(); logger.addAppender(createAppender(conf.getLogOutput())); } logger.setLevel(Level.toLevel(level)); }
private static void setCustomRootAppender(LoggingConfiguration conf) { Logger logger = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME); String level = StringUtils.defaultIfBlank(conf.getSubstitutionVariables().get(LoggingConfiguration.PROPERTY_ROOT_LOGGER_LEVEL), LoggingConfiguration.LEVEL_ROOT_DEFAULT); if (logger.getAppender(CUSTOM_APPENDER_NAME) == null) { logger.detachAndStopAllAppenders(); logger.addAppender(createAppender(conf.getLogOutput())); } logger.setLevel(Level.toLevel(level)); }
public static void apply(LoggingConfiguration conf, File logbackFile) { Logback.configure(logbackFile, conf.getSubstitutionVariables()); if (conf.getLogOutput() != null) { setCustomRootAppender(conf); } }
public static void apply(LoggingConfiguration conf, File logbackFile) { Logback.configure(logbackFile, conf.getSubstitutionVariables()); if (conf.getLogOutput() != null) { setCustomRootAppender(conf); } }
public static void apply(LoggingConfiguration conf, String classloaderPath) { Logback.configure(classloaderPath, conf.getSubstitutionVariables()); // if not set, keep default behavior (configured to stdout through the file in classpath) if (conf.getLogOutput() != null) { setCustomRootAppender(conf); } }
public static void apply(LoggingConfiguration conf, String classloaderPath) { Logback.configure(classloaderPath, conf.getSubstitutionVariables()); // if not set, keep default behavior (configured to stdout through the file in classpath) if (conf.getLogOutput() != null) { setCustomRootAppender(conf); } }