Quarkus -log SQL由JDBC发送,而不是Hibernate和JDBC之间
我正在使用 quarkus 2.7.4.Final 和 quarkus-hibernate-orm 与 postgresql 12
我已经从 Hibernate 记录了 sql,感谢以下配置(application.properties)
quarkus.datasource.db-kind = postgresql
quarkus.datasource.username = postgres
quarkus.datasource.password = root
quarkus.hibernate-orm.database.generation=none
quarkus.hibernate-orm.log.sql=true
quarkus.hibernate-orm.log.format-sql=false
quarkus.hibernate-orm.log.bind-parameters=true
quarkus.datasource.jdbc.url = jdbc:postgresql://localhost:5432/formationhibernatetest
quarkus.log.level=TRACE
quarkus.log.min-level=TRACE
我在 quarkus 指南上找不到如何记录 jdbc 的 sql 请求司机。 在其他项目中,我使用了P6SPY或datasource-proxy-spring-boot-starter(带有springboot)
那么,使用quarkus有没有办法记录jdbc驱动程序发送的真实sql请求?
谢谢你的帮助 祝你今天过得愉快 尼古拉斯
I am using quarkus 2.7.4.Final and quarkus-hibernate-orm with postgresql 12
I alwready log sql from Hibernate thanks to the following config (application.properties)
quarkus.datasource.db-kind = postgresql
quarkus.datasource.username = postgres
quarkus.datasource.password = root
quarkus.hibernate-orm.database.generation=none
quarkus.hibernate-orm.log.sql=true
quarkus.hibernate-orm.log.format-sql=false
quarkus.hibernate-orm.log.bind-parameters=true
quarkus.datasource.jdbc.url = jdbc:postgresql://localhost:5432/formationhibernatetest
quarkus.log.level=TRACE
quarkus.log.min-level=TRACE
I don't found on quarkus guides how can logs sql request by the jdbc driver.
On other projects I have used P6SPY or datasource-proxy-spring-boot-starter (with springboot)
So, with quarkus is there a way to log the real sql request sent by the jdbc driver ?
Thanks for your help
Have a nice day
Nicolas
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最简单的方法是像您已经一样通过Hibernate登录。
如果要登录JDBC级别,则可以使用P6SPY,为此,您需要使用“其他” DB型配置数据库,配置P6Spy驱动程序并指定Hibernate方言,因为Hibernate将无法自动检测到它。
The easiest way is to log via Hibernate as you already did.
If you want to log at the JDBC level you can uses P6SPY, for this you need to configure your datasoure with the 'other' db-kind, configure the P6SPY driver and specify the Hibernate dialect as Hibernate will not be able to automatically detect it.