<?xml version="1.0" encoding="UTF-8"?>
<!-- 该xml配置中,xml元素大小写不敏感 -->
<!-- status="off",log4j2把自身事件记录到控制台的配置，off表示不记录，其余的记录有trace，debug，info，warn，error，fatal -->
<!-- monitorInterval表示检测更改配置的时间,单位是秒,最小间隔为5秒,0或负数表示不检测 -->
<configuration name="test-cfg" status="off" monitorInterval="0">

    <!-- 常量引用 -->
    <properties>
        <property name="LOG_HOME">/data/logs/identify</property>
        <property name="LOG_NAME">bcx_identify</property>
        <property name="FORMAT">%d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n</property>
    </properties>

    <!-- appender用于接收各种日志 -->
    <appenders>
        <!-- 常见的输出到console,常用于开发环境中,默认是system_err,还有一个system_out -->
        <console name="console" target="system_out">
            <!-- appender级别的日志过滤 -->
            <!-- <thresholdFilter level="info" onMatch="accept" onMismatch="deny"/> -->
            <patternLayout pattern="${FORMAT}" />
        </console>
        <!-- 常用于开发环境,把日志记录到文件中,默认追加 -->
        <file name="file" fileName="${LOG_HOME}/${LOG_NAME}.log" append="false">
            <patternLayout pattern="${FORMAT}" />
        </file>
    </appenders>

    <!-- 接收appender -->
    <loggers>
        <logger name="org.apache.http" level="error" />
        <!-- Spring -->
        <logger name="org.springframework" level="error" />
        <!-- mybatis loggers -->
        <logger name="com.baomidou.mybatisplus" level="error" />
        <logger name="org.apache.ibatis" level="error" />
        <logger name="org.mybatis.spring" level="error" />
        <logger name="com.ibatis" level="error" />
        <logger name="com.ibatis.common.jdbc.SimpleDataSource" level="error" />
        <logger name="com.ibatis.common.jdbc.ScriptRunner" level="error" />
        <logger name="com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate" level="error" />
        <!-- sql loggers -->
        <logger name="java.sql.Connection" level="error"  additivity="true"/>
        <logger name="java.sql.Statement" level="error" additivity="true" />
        <logger name="java.sql.PreparedStatement" level="=debug,stdout"  additivity="true"/>
        <logger name="java.sql.ResultSet" level="error"  additivity="true"/>
        <!-- General Apache libraries -->
        <!--<logger name="org.apache" level="WARN" />-->
        <!-- Default Shiro logging -->
        <logger name="org.apache.shiro" level="error" />
        <!-- Disable verbose logging -->
        <logger name="org.apache.shiro.util.ThreadContext" level="error" />
        <logger name="org.apache.shiro.cache.ehcache.EhCache" level="error" />
        <!-- 对包进行更详细的配置 -->
        <!-- additivity表示是否追加,防止重复,因为root已经接收过一次了 -->
        <logger name="com.bcxin.identify" level="error" additivity="false">
            <appender-ref ref="file" />
        </logger>
        <!-- root logger,一般用于放置所有的appender -->
        <root level="ERROR">
            <appender-ref ref="file" />
        </root>
    </loggers>

</configuration>