我在web.xml中設(shè)置了一個(gè)自定義的log4jConfigLocation位置 <!--Log4J配置--><context-param><param-name>webAppRootKey</param-name><param-value>DPCM.root</param-value></context-param><context-param> <param-name>log4jConfigLocation</param-name> <param-value>classpath:conf/log/log4j.xml</param-value></context-param><context-param> <param-name>log4jRefreshInterval</param-name> <param-value>60000</param-value></context-param><listener> <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class></listener>在Intellij IDEA 中運(yùn)行 使用war exploded 模式 也就是 使用文件夾方式部署,可以正常啟動(dòng), 而使用war方式部署,會(huì)得到錯(cuò)誤提示log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).log4j:WARN Please initialize the log4j system properly.log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
自定義log4j配置文件路徑后,只能使用文件夾形式(war exploded模式)部署
慕工程0101907
2019-03-20 18:15:08