在Spring Boot中,SQL语句的参数值被记录为?(问号)。
在Spring Boot中,SQL语句的参数值被记录为?(问号)。
我想将SQL语句记录到文件中。
我在application.properties
中有以下属性:
spring.datasource.url=... spring.datasource.username=user spring.datasource.password=1234 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=c:/temp/my-log/app.log
运行我的应用程序时,
cmd> mvn spring-boot:run
我可以在控制台中看到SQL语句,但它们不会出现在app.log中。该文件仅包含来自Spring的基本日志。
我应该怎么做才能在日志文件中看到SQL语句?
admin 更改状态以发布 2023年5月21日