Only warn on old log configs if resolving configs

A warning was introduced if old log config files are present (e.g.,
logging.yml). However, this check is executed unconditionally. This can
lead to no such file exceptions when logging configs are not being
resolved, for example when installing a plugin. This commit moves this
check to only execute when logging configs are being resolved.
This commit is contained in:
Jason Tedor 2016-09-03 09:48:09 -04:00
parent e297fd419b
commit 41637a1294
1 changed files with 1 additions and 2 deletions

View File

@ -78,6 +78,7 @@ public class LogConfigurator {
}
});
context.start(new CompositeConfiguration(configurations));
warnIfOldConfigurationFilePresent(environment);
}
if (ESLoggerFactory.LOG_DEFAULT_LEVEL_SETTING.exists(settings)) {
@ -89,8 +90,6 @@ public class LogConfigurator {
final Level level = ESLoggerFactory.LOG_LEVEL_SETTING.getConcreteSetting(key).get(settings);
Loggers.setLevel(Loggers.getLogger(key.substring("logger.".length())), level);
}
warnIfOldConfigurationFilePresent(environment);
}
private static void warnIfOldConfigurationFilePresent(final Environment environment) throws IOException {