配置application.yml或application.properties
1. 结合mybatis
1 mybatis: 2 type-aliases-package: com.example.pojo 3 mapper-locations: classpath:mapper/*.xml 4 configuration: 5 log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
2. 使用logging模块
方式一:application.yml
1 ## 设置debug可以打印Sql语句 2 logging: 3 level: 4 com: 5 company: 6 cache: debug 7 ## 或者这样写 8 com.company.cache: debug
方式二:application.properties
1 logging.level.com.company.cache=debug