mybatis使用用stdout-logging日志显示sql语句

在开发中,我们很多时候需要知道当前执行的sql语句是什么样的,但是默认

mybatis是不显示sql的,此时我们就可以使用stdout-logging了。

1、创建mybatis-config.xml文件,并配置stdout-logging:





    
        
    

2、在application.properties文件中配置mybatis-config.xml文件:

#mybatis配置文件的位置
mybatis.config-location=classpath:mybatis-config.xml

 

你可能感兴趣的:(Mybatis)