将 formatMsgNoLookups 放在 Log4j XML 配置文件中的位置
我用XML文件配置我的Log4j。我应该在哪里添加格式MsgNoLookups=true?
<?xml version="1.0" encoding="UTF-8"?>
<!-- Upload files compare config -->
<configuration status="OFF">
<appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{HH:mm:ss} %p - %msg%n"/>
</Console>
<!-- http://logging.apache.org/log4j/2.x/manual/appenders.html#RollingFileAppender -->
<RollingFile name="File" fileName="logs/MyLogFile.log"
filePattern="logs/MyLogFile-%d{yyyy-MM-dd}.log"
ignoreExceptions="false">
<PatternLayout>
<Pattern>%d %p %c{1.} %m%n</Pattern>
</PatternLayout>
</RollingFile>
</appenders>
<Loggers>
<Root level="INFO">
<AppenderRef ref="File"/>
<AppenderRef ref="Console"/>
</Root>
</Loggers>
</configuration>