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:
parent
e297fd419b
commit
41637a1294
|
@ -78,6 +78,7 @@ public class LogConfigurator {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
context.start(new CompositeConfiguration(configurations));
|
context.start(new CompositeConfiguration(configurations));
|
||||||
|
warnIfOldConfigurationFilePresent(environment);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ESLoggerFactory.LOG_DEFAULT_LEVEL_SETTING.exists(settings)) {
|
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);
|
final Level level = ESLoggerFactory.LOG_LEVEL_SETTING.getConcreteSetting(key).get(settings);
|
||||||
Loggers.setLevel(Loggers.getLogger(key.substring("logger.".length())), level);
|
Loggers.setLevel(Loggers.getLogger(key.substring("logger.".length())), level);
|
||||||
}
|
}
|
||||||
|
|
||||||
warnIfOldConfigurationFilePresent(environment);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void warnIfOldConfigurationFilePresent(final Environment environment) throws IOException {
|
private static void warnIfOldConfigurationFilePresent(final Environment environment) throws IOException {
|
||||||
|
|
Loading…
Reference in New Issue