log4j2将debug记录到文件,但如果切换到info则为空

时间:2017-04-11 02:17:39

标签: selenium debugging logging log4j2 info

即使我正在为调试文件编写日志,我的info.log仍然是空的... 任何帮助将不胜感激!

控制台通常记录INFO

<Appenders>
    <Console name="Console" target="SYSTEM_OUT">
        <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n" />
    </Console>

    <File name="DebugFile" fileName="logs/Debug.log" immediateFlush="false" append="true">
        <PatternLayout pattern="%d{yyy-MM-dd HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
    </File>

    <File name="InfoFile" fileName="logs/Info.log" immediateFlush="false" append="false">
        <PatternLayout pattern="%d{yyy-MM-dd HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
    </File>        
</Appenders>

<Loggers>
    <Root level="debug">
        <AppenderRef ref="Console" level="info"/>
        <AppenderRef ref="DebugFile" level="debug"/>
        <AppenderRef ref="InfoFile" level="info"/>
    </Root>
</Loggers>

0 个答案:

没有答案