Log4j: warn no appenders cocould be found for logger (Org. springframework. Web. Context. contextloader ).

Source: Internet
Author: User

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>

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.