以前使用log4j,后台可以打印sql日志,现在换成log4j2了,所有日志都不打印了,怎么破
下面是我log4j2.xml的内容
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Properties>
<!-- %highlight{ 内容 }{FATAL=bright black, ERROR=bright red, WARN=bright yellow, INFO=blue, DEBUG=bright black, TRACE=bright black} -->
<Property name="rawPattern">
%highlight{[%-5level][%d{yyyy-MM-dd HH:mm:ss.SSS}]%l}{FATAL=bright black, ERROR=bright red, WARN=bright yellow, INFO=blue, DEBUG=bright black, TRACE=bright black}%message%n
</Property>
</Properties>
<Appenders>
<!-- 控制台配置 -->
<Console name="console"
target="SYSTEM_OUT">
<PatternLayout pattern="${rawPattern}" />
<ThresholdFilter level="DEBUG" />
</Console>
<!-- 每小时一个日志 -->
<RollingFile name="rollingFile"
fileName="../logs/log.log"
filePattern="../logs/$${date:yyyy}/$${date:yyyy-MM}/$${date:yyyy-MM-dd}/%d{yyyy-MM-dd_HH}.log">
<PatternLayout pattern="[%-5level][%d{yyyy-MM-dd HH:mm:ss.SSS}]%l%message%n" />
<ThresholdFilter level="ALL" />
<Policies>
<TimeBasedTriggeringPolicy interval="1"
modulate="true" />
</Policies>
<DefaultRolloverStrategy>
<Delete basePath="../logs/"
maxDepth="5">
<IfFileName glob="*.log" />
<IfLastModified age="30d" />
</Delete>
</DefaultRolloverStrategy>
</RollingFile>
</Appenders>
<Loggers>
<!-- 日志级别有:OFF、FATAL、ERROR、WARN、INFO、DEBUG、TRACE、ALL -->
<!-- 同步日志 -->
<!--<Root level="ALL">
<AppenderRef ref="console" />
<AppenderRef ref="rollingFile" />
</Root>-->
<!-- 异步日志 -->
<AsyncRoot level="ALL"
includeLocation="true">
<AppenderRef ref="console" />
<AppenderRef ref="rollingFile" />
</AsyncRoot>
</Loggers>
</Configuration>