WARN No Appenders could is found for logger

Source: Internet
Author: User
Tags log4j

Error message: Log4j:warn No appenders could is found for logger (org.springframework.web.context.ContextLoader).
Log4j:warn Please initialize the log4j system properly.


Workaround: Add the document to the web-inf/classes/path log4j.properties its reference content as follows

# Set Root Logger level to error
Log4j.rootlogger=info, Console, File

###### Console appender Definition #######

# All outputs currently set to be a consoleappender.
Log4j.appender.console=org.apache.log4j.consoleappender
Log4j.appender.console.layout=org.apache.log4j.patternlayout
Log4j.appender.console.layout.conversionpattern=%d{absolute}%-5p [%c{3}]%m%n
#log4j. Appender.console.layout.conversionpattern=%d{absolute}%-5p [%c]%m%n

###### File appender Definition #######
Log4j.appender.file=org.apache.log4j.dailyrollingfileappender
Log4j.appender.file.file=spring.log
Log4j.appender.file.append=false
Log4j.appender.file.layout=org.apache.log4j.patternlayout
Log4j.appender.file.layout.conversionpattern=%d{absolute}%-5p [%c]%m%n

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.