SpringBoot中如何输出SQL语句呢?
下文笔者讲述SpringBoot中打印出SQL语句的方法分享,如下所示
//SpringBoot输出SQL语句 logging.level.org.hibernate.SQL=DEBUG logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE例:application.properties配置如下
spring.datasource.url=... spring.datasource.username=user spring.datasource.password=123456789 spring.datasource.driver-class-name=net.sourceforge.jtds.jdbc.Driver spring.jpa.show-sql=true spring.jpa.properties.hibernate.format_sql=true security.ignored=true security.basic.enabled=false logging.level.org.springframework.web=INFO logging.level.org.hibernate=INFO logging.file=d:/test/app.log
版权声明
本文仅代表作者观点,不代表本站立场。
本文系作者授权发表,未经许可,不得转载。