You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In application.properties file I had ~ by mistake ~ a trailing space in property logging.config
That leads to an failed appication start.
Such simple config error should be automatically fixed by triming trailing whitespace from value of logging.config
private void initializeSystem(ConfigurableEnvironment environment, LoggingSystem system, LogFile logFile) {
LoggingInitializationContext initializationContext = new LoggingInitializationContext(environment);
String logConfig = environment.getProperty(CONFIG_PROPERTY);
if (ignoreLogConfig(logConfig)) {
system.initialize(initializationContext, null, logFile);
}
else {
try {
// ---> here some trimTrailingWhitespace(logConfig) <---
ResourceUtils.getURL(logConfig).openStream().close();
system.initialize(initializationContext, logConfig, logFile);
}
catch (Exception ex) {
// NOTE: We can't use the logger here to report the problem
System.err.println("Logging system failed to initialize using configuration from '" + logConfig + "'");
ex.printStackTrace(System.err);
throw new IllegalStateException(ex);
}
}
}
logging.config=config/logback_apiserver.xml with trailing whitespace(s)
Current Stacktrace without trim trailing whitespace:
2020-06-23 13:09:37.975 INFO [,,,] 24824 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$e6aaebb] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
Logging system failed to initialize using configuration from 'config/logback.xml '
java.io.FileNotFoundException: /opt/myApplication/config/logback.xml (No such file or directory)
at java.base/java.io.FileInputStream.open0(Native Method)
at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
at java.base/java.io.FileInputStream.<init>(FileInputStream.java:112)
at java.base/sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:86)
at java.base/sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:184)
at java.base/java.net.URL.openStream(URL.java:1140)
at org.springframework.boot.context.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:317)
at org.springframework.boot.context.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:288)
......
The text was updated successfully, but these errors were encountered:
We don't want to trim whitespace everywhere (#4106) but we have trimmed it in places where we feel that we can safely do so (#15972, for example). I think it's really unlikely that a logging config file's name would deliberately have trailing whitespace so it should be safe to trim it in this case. On the other hand, the current failure shows the problem so it's hopefully quite easy to identify it and fix it at source rather than relying on Boot tidying things up. Let's see what the rest of the team thinks.
In application.properties file I had ~ by mistake ~ a trailing space in property logging.config
That leads to an failed appication start.
Such simple config error should be automatically fixed by triming trailing whitespace from value of logging.config
Related code:
https://github.com/spring-projects/spring-boot/blob/master/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/logging/LoggingApplicationListener.java
logging.config=config/logback_apiserver.xml
with trailing whitespace(s)Current Stacktrace without trim trailing whitespace:
The text was updated successfully, but these errors were encountered: