application-context.xml
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
...
<property name="configLocation" value="classpath:/META-INF/mybatis/mybatis-config.xml" />
...
</bean>
mybatis-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd" >
<configuration>
<settings>
<setting name="logImpl" value="STDOUT_LOGGING"/>
</settings>
</configuration>
参考:
http://www.mybatis.org/mybatis-3/logging.html
http://www.mybatis.org/mybatis-3/configuration.html
http://www.mybatis.org/spring/factorybean.html
http://stackoverflow.com/questions/21718097/how-to-configure-logback-for-mybatis-to-print-my-sql