sprint boot啟動日誌為空的問題
spring boot 1.5.7Release版本中啟動時遇到了如下的錯誤,只有這一行的日誌錯誤
DEBUG org.springframework.boot.logging.ClasspathLoggingApplicationListener - Application failed to start with classpath: [file:/C:/Program%20Files/Java/jdk1.8.0_161/jre/lib/resources.jar, file:/C:/Program%20Files/Java/jdk1.8.0_161/jre/lib/rt.jar, file:/C:/Program%20Files/Java/jdk1.8.0_161/jre/lib/jsse.jar, file:/C:/Program%20Files/Java/jdk1.8.0_161/jre/lib/jce.jar, file:/C:/Program%20Files/Java/jdk1.8.0_161/jre/lib/charsets.jar, file:/C:/Program%20Files/Java/jdk1.8.0_161/jre/lib/jfr.jar,
查了百度無果,除錯ClasspathLoggingApplicationListener,在SpringApplication.handleRunFailure中,Exception被消掉,並且沒有輸出日誌,原來是讀取application.yml出錯,導致日誌的相關配置都沒有載入, 整個程式錯誤
java.lang.IllegalStateException: Failed to load property source from location 'classpath:/application.yml'
然後我們修改application.yml中有問題的地方,修改完以後spring boot正常起來,並且輸出日誌