在mybatis-config.xml :
<settings>
<setting name="logImpl" value="STDOUT_LOGGING" /><!-- LOG4J STDOUT_LOGGING-->
</settings>
如果是hibernate的话要设置一下
查看config-local.properties文件里面hibernate.show_sql=true
其他方式:https://blog.csdn.net/c2311156c/article/details/82862616