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