logback 打印sql语句:
在logback日志文件中开启debug模式
- <logger name="com.ibatis" level="DEBUG" />
- <logger name="com.ibatis.common.jdbc.SimpleDataSource" level="DEBUG" />
- <logger name="com.ibatis.common.jdbc.ScriptRunner" level="DEBUG" />
- <logger name="com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate" level="DEBUG" />
- <logger name="java.sql.Connection" level="DEBUG" />
- <logger name="java.sql.Statement" level="DEBUG" />
- <logger name="java.sql.PreparedStatement" level="DEBUG" />
- <logger name="java.sql.ResultSet" level="DEBUG" />
- <logger name="你的dao的包名" level="DEBUG" />
打印sql返回结果:
在mybatis-config.xml中开启:
- <settings>
- <setting name="logImpl" value="STDOUT_LOGGING"/>
- </settings>
原文地址:https://blog.csdn.net/qq_25825923/article/details/84255579