![](/img/trans.png)
[英]External Log4j.properties in not printing logs - spring boot 2.2.1
[英]How do I get logs for the startup sequence if I use Spring External log4j.properties file?
因此,問題在於此應用程序的啟動順序很重要,因為它在首次啟動時需要從數據庫中獲取一些信息。 如果我在web.xml文件中使用它:
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>classpath:log4j.applicationName.properties</param-value>
</context-param>
<context-param>
<param-name>log4jRefreshInterval</param-name>
<param-value>10000</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
上面的問題是,它需要Spring 10000 ...毫秒? ..so然后10秒鍾加載屬性文件,我在日志中看不到任何啟動順序。
對。 它必須在上下文加載偵聽器之前。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.