Quarkus -log SQL由JDBC发送,而不是Hibernate和JDBC之间

发布于 2025-01-17 21:25:56 字数 790 浏览 2 评论 0原文

我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一杯敬自由 2025-01-24 21:25:56

最简单的方法是像您已经一样通过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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文