|
|
@ -305,15 +305,16 @@ public class LoggingApplicationListener implements GenericApplicationListener {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void initializeSystem(ConfigurableEnvironment environment, LoggingSystem system, LogFile logFile) {
|
|
|
|
private void initializeSystem(ConfigurableEnvironment environment, LoggingSystem system, LogFile logFile) {
|
|
|
|
LoggingInitializationContext initializationContext = new LoggingInitializationContext(environment);
|
|
|
|
|
|
|
|
String logConfig = StringUtils.trimWhitespace(environment.getProperty(CONFIG_PROPERTY));
|
|
|
|
String logConfig = StringUtils.trimWhitespace(environment.getProperty(CONFIG_PROPERTY));
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
LoggingInitializationContext initializationContext = new LoggingInitializationContext(environment);
|
|
|
|
if (ignoreLogConfig(logConfig)) {
|
|
|
|
if (ignoreLogConfig(logConfig)) {
|
|
|
|
system.initialize(initializationContext, null, logFile);
|
|
|
|
system.initialize(initializationContext, null, logFile);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
try {
|
|
|
|
|
|
|
|
system.initialize(initializationContext, logConfig, logFile);
|
|
|
|
system.initialize(initializationContext, logConfig, logFile);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
catch (Exception ex) {
|
|
|
|
catch (Exception ex) {
|
|
|
|
Throwable exceptionToReport = ex;
|
|
|
|
Throwable exceptionToReport = ex;
|
|
|
|
while (exceptionToReport != null && !(exceptionToReport instanceof FileNotFoundException)) {
|
|
|
|
while (exceptionToReport != null && !(exceptionToReport instanceof FileNotFoundException)) {
|
|
|
@ -326,7 +327,6 @@ public class LoggingApplicationListener implements GenericApplicationListener {
|
|
|
|
throw new IllegalStateException(ex);
|
|
|
|
throw new IllegalStateException(ex);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private boolean ignoreLogConfig(String logConfig) {
|
|
|
|
private boolean ignoreLogConfig(String logConfig) {
|
|
|
|
return !StringUtils.hasLength(logConfig) || logConfig.startsWith("-D");
|
|
|
|
return !StringUtils.hasLength(logConfig) || logConfig.startsWith("-D");
|
|
|
|