log4j Logging and Webapprootkey relationships

Source: Internet
Author: User

Today found a problem, that is, the background from the beginning of a day to no longer log logs , and finally found that the value of Webapprootkey must be consistent with the LOG4J injection variable.

As follows: The webapprootkey node of the Web. xml file: value = Mes

1     <context-param>2         <param-name>webAppRootKey</param-name>3         < param-value>Mes</param-value>4     </context-param>

But the variable injected by log4j.properties = webapp.root, inconsistent .

Two places to be consistent:

1Log4j.rootlogger=error,stdout,d2log4j.appender.stdout=Org.apache.log4j.ConsoleAppender3Log4j.appender.stdout.target=system. out4log4j.appender.stdout.layout=Org.apache.log4j.PatternLayout5log4j.appender.stdout.layout.conversionpattern=%d{absolute}%5p%c{1}:%l-%m%N6Log4j.appender.d=Org.apache.log4j.DailyRollingFileAppender7Log4j.appender.d.threshold=ERROR8log4j.appender.d.file=${Mes}/web-inf/logs/Log9log4j.appender.d.datepattern='_'Yyyy-mm-dd'. Log'TenLog4j.appender.d.append=true Onelog4j.appender.d.layout=Org.apache.log4j.PatternLayout ALog4j.appender.d.layout.conversionpattern=%-d{yyyy-mm-dd HH:MM:SS} [%t:%r]-[%p]%m%n

log4j Logging and Webapprootkey relationships

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.