maven 引入 和 log4j2.xml 如下,找半天没有结果,求救啊
<!-- log4j2 的核心包 -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.6</version>
</dependency>
<!-- 将log4j 1.x 的调用路由到 Log4j 2.x 上, nutz中的适配器目前支持Log4j 1.x版本,所以需要通过桥接来使用 Log4j 2.x -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-1.2-api</artifactId>
<version>2.6</version>
</dependency>
<?xml version="1.0" encoding="UTF-8"?>
<configuration status="info" packages="com.nari.nwims.smspusher">
<properties>
<!-- 控制台输出日志格式 -->
<property name="patterns.console">%d %-5p [%t] %C{1} - %m%n</property>
<!-- 日志文件输出日志格式 -->
<Property name="patterns.file">%d %-5p [%t] %C - %m%n</Property>
<!-- 日志文件大小 -->
<Property name="file.size">50 MB</Property>
<!-- 日志文件最大个数 -->
<Property name="file.maxIndex">10</Property>
</properties>
<appenders>
<console name="console" target="SYSTEM_OUT">
<!--这个都知道是输出日志的格式-->
<PatternLayout pattern="${patterns.console}"/>
</console>
<routing name="routing">
<routes pattern="$${thread:threadName}">
<route>
<rollingFile name="logFile-${thread:threadName}"
fileName="log/${thread:threadName}.log"
filePattern="log/$${date:yyyy-MM}/${thread:threadName}-%d{MM-dd-yyyy}-%i.log.gz">
<patternLayout pattern="${patterns.file}"/>
<policies>
<sizeBasedTriggeringPolicy size="${file.size}"/>
</policies>
<defaultRolloverStrategy max="${file.maxIndex}"/>
</rollingFile>
</route>
</routes>
</routing>
<async name="async" bufferSize="1000" includeLocation="true">
<appenderRef ref="routing"/>
<appenderRef ref="console"/>
</async>
</appenders>
<loggers>
<logger name="com.nari.nwims.smspusher" level="debug"/>
<logger name="org.nutz" level="info"/>
<root level="debug">
<!--<appenderRef ref="async" />-->
<appenderRef ref="console"/>
<appenderRef ref="routing"/>
</root>
</loggers>
</configuration>