在平常开发过程当中,常常要打印sql语句来验证功能是否正常,这就须要打印sqljava
在最先的hibernate时代,能够使用show_sql来打印sqlweb
使用mybatis打印时,能够配置logback的日志来使日志打印spring
eg.. <logger name="org.apache.ibatis" level="debug"/>sql
而在mybatis升级到3.4时,这种方式已经不能使用,正确的使用方式为:apache
<logger name="com.thomas.web" level="debug"/>springboot
此包为咱们本身的工程包,只要包含mapper.java便可mybatis
实验事后发现 logger下方增长<append-ref>来指定file或者console无效app
在springboot中能够使用logback-spring.xml来指定不一样的profile来区分环境hibernate