title: Why mybatis force prints log4j DEBUG info to the console
body: <p>I've already configured mybatis to use log4j for logging. And I configured log4j to only print warning info. But when I run it, mybatis prints lots of sql debug messages to the console:</p>
  
  <pre><code>&lt;http-bio-80-exec-1 10:08:54,969&gt; &lt;org.apache.ibatis.logging.jdbc.BaseJdbcLogger:139&gt; DEBUG - ==&gt;  Preparing: select count(*) from accounts 
  &lt;http-bio-80-exec-1 10:08:54,993&gt; &lt;org.apache.ibatis.logging.jdbc.BaseJdbcLogger:139&gt; DEBUG - ==&gt; Parameters: 
  &lt;http-bio-80-exec-1 10:08:55,093&gt; &lt;org.apache.ibatis.logging.jdbc.BaseJdbcLogger:139&gt; DEBUG - &lt;==      Total: 1
  </code></pre>
  
  <p>mybatis.xml file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
  &lt;!DOCTYPE configuration PUBLIC "-//xml.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"&gt;
  &lt;configuration&gt;
      &lt;settings&gt;
          &lt;setting name="logImpl" value="LOG4J"/&gt;
      &lt;/settings&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>log4j.properties file:</p>
  
  <pre><code># appenders
  logFormat=&lt;%t %d{HH:mm:ss,SSS}&gt; &lt;%C:%L&gt; %-5p - %m%n
  log4j.appender.appender_console=org.apache.log4j.ConsoleAppender
  log4j.appender.appender_console.layout=org.apache.log4j.PatternLayout
  log4j.appender.appender_console.layout.ConversionPattern=${logFormat}
  log4j.appender.appender_file=org.apache.log4j.DailyRollingFileAppender
  log4j.appender.appender_file.layout=org.apache.log4j.PatternLayout
  log4j.appender.appender_file.layout.ConversionPattern=${logFormat}
  log4j.appender.appender_file.File=${webRootDir}/../../../logs/log
  log4j.appender.appender_file.DatePattern='-'yyyy.MM.dd'.log'
  
  # config for all packages
  log4j.rootLogger=WARN, appender_console, appender_file
  
  # config for specific packages
  log4j.logger.my_package=DEBUG
  log4j.logger.com.ibatis=WARN
  log4j.logger.com.ibatis.common.jdbc.SimpleDataSource=WARN
  log4j.logger.com.ibatis.common.jdbc.ScriptRunner=WARN
  log4j.logger.com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate=WARN
  log4j.logger.java.sql.Connection=WARN
  log4j.logger.java.sql.Statement=WARN
  log4j.logger.java.sql.PreparedStatement=WARN
  log4j.logger.java.sql.ResultSet=WARN
  log4j.logger.org.apache.ibatis.logging.jdbc.BaseJdbcLogger=WARN
  </code></pre>
  
  <p>applicationContext.xml file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:context="http://www.springframework.org/schema/context"
         xsi:schemaLocation="
              http://www.springframework.org/schema/beans
              http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
              http://www.springframework.org/schema/context
              http://www.springframework.org/schema/context/spring-context-3.0.xsd
  "&gt;
  
  
  
      &lt;!-- for springmvc &amp; mybatis source scanning --&gt;
      &lt;bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"&gt;
          &lt;property name="basePackage" value="***" /&gt;
      &lt;/bean&gt;
      &lt;context:component-scan base-package="***" /&gt;
  
  
  
      &lt;!-- for database --&gt;
      &lt;context:property-placeholder ignore-unresolvable="true" location="classpath:config/jdbc.properties" /&gt;
      &lt;bean id="dbcp2_mysql" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close"&gt;
          &lt;property name="driverClassName" value="${dbcp2_mysql.driverClassName}" /&gt;
          &lt;property name="url" value="${dbcp2_mysql.url}" /&gt;
          &lt;property name="username" value="${dbcp2_mysql.username}" /&gt;
          &lt;property name="password" value="${dbcp2_mysql.password}" /&gt;
          &lt;!--&lt;property name="initialSize" value="${dbcp2_mysql.initialSize}" /&gt;--&gt;
          &lt;!--&lt;property name="maxIdle" value="${dbcp2_mysql.maxIdle}" /&gt;--&gt;
          &lt;!--&lt;property name="minIdle" value="${dbcp2_mysql.minIdle}" /&gt;--&gt;
      &lt;/bean&gt;
      &lt;bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"&gt;
          &lt;property name="dataSource" ref="dbcp2_mysql" /&gt;
          &lt;property name="mapperLocations" value="classpath:***" /&gt;
          &lt;property name="configLocation" value="classpath:config/mybatis.xml"&gt;&lt;/property&gt;
          &lt;property name="typeAliases" value="org.springframework.util.LinkedCaseInsensitiveMap" /&gt;
          &lt;property name="transactionFactory"&gt;
              &lt;bean class="org.apache.ibatis.transaction.managed.ManagedTransactionFactory" /&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>PS: I am using intellij IDEA</p>