java - Log4j 2: How to Use XMLLayout? -
java - Log4j 2: How to Use XMLLayout? -
the log4j 2 manual states:
an appender uses layout format logevent form meets needs of whatever consuming log event.
among several of appenders in log4j2.xjm, have this:
<rollingfile name="rollingratefile" filename="${sys:webapp.rollinglogspath}/${sys:webapp.name}.rate.log" filepattern="${sys:webapp.rollinglogspath}/${sys:webapp.name}.log-%d{yyyy-mm-dd}-%i.rate.log"> <patternlayout> <pattern>%d{yyyy-mm-dd hh:mm:ss.sss} %m%n</pattern> </patternlayout> <policies> <sizebasedtriggeringpolicy size="10 mb" /> </policies> <defaultrolloverstrategy min="1" max="4" /> <xmllayout complete="true" charset="utf-8" compact="false"/> </rollingfile>
when tomcat starts, error:
2014-11-06 12:45:40,631 error appender rollingfile has no parameter matches element xmllayout 2014-11-06 12:45:40,696 error appender rollingfile has no parameter matches element xmllayout
logging standard log file works great when omit xmllayout
element. can't seem locate examples of how correclty utilize xmllayout
. know i'm doing wrong?
it turns out patternlayout
mutually exclusive xmllayout
. when patternlayout
removed, xmllayout
works.
java tomcat7 log4j2
Comments
Post a Comment