[OsChina] logback中mybatis打印SQL

发表于:  阅读量:19026

摘要

1.在mybatis配置文件中mybatis-config.xml配置文件中加入settings部分<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEconfigurationPUBLIC"-//mybatis.org//DTDConfig3.0//EN""http:...

1.在mybatis配置文件中

mybatis-config.xml配置文件中加入settings部分

<?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="logPrefix" value="daoLog."/>
    </settings>

</configuration>

 

2.logback.xml加入

<logger name="daoLog" level="debug" additivity="false">
    <appender-ref ref="stdout"/>
</logger>

 

3.console输出如下

 

4.参考文章

http://www.cnblogs.com/beiyeren/p/4196134.html

关键词:
-->
渝ICP备16002246号 Copyright © 2017. Singee77.com