In spring web projects, this kind of prompt often appears when Tomcat is started: Reference log4j: warn no appenders cocould be found for logger (Org. springframework. Web. Context. contextloader ).
Log4j: Warn please initialize the log4j system properly.
There are a lot of solutions available on the Internet, this prompt should be reported before reading the log4j. properties file of the Web application. The log4j configuration file is not found when the listener org. springframework. Web. Context. contextloader is loaded.
View the web. XML is found in loading Org. springframework. web. context. the listener of contextloader is loaded before Org. springframework. web. util. log4jconfiglistener: Put the log4j configuration in org. springframework. web. context. you can solve this problem before contextloader.
<! -- The following three parameters are related to log4j configuration --> <context-param> <param-Name> log4jconfiglocation </param-Name> <param-value>/WEB-INF/log4j. properties </param-value> </context-param> <param-Name> log4jrefresh interval </param-Name> <param-value> 60000 </param- value> </context-param> <listener-class> Org. springframework. web. util. log4jconfiglistener </listener-class> </listener> <! -- End --> <listener-class> org. springframework. Web. Context. contextloaderlistener </listener-class> </listener>