geoand
geoand

Reputation: 64011

How can I log SQL statements in created by my Quarkus application?

I am using Quarkus application with the Hibernate extension and I would like Hibernate to show the generated SQL query. I am not sure how that could be accomplished.

What's the best way to accomplish that? What's the proper way to configure such a feature?

Upvotes: 14

Views: 22922

Answers (1)

geoand
geoand

Reputation: 64011

The Quarkus property that controls this behavior is quarkus.hibernate-orm.log.sql (which is set to false by default).

By simply setting quarkus.hibernate-orm.log.sql=true in application.properties, Quarkus will show and format the SQL queries that Hibernate issues to the database. Note that the Hibernate configuration is not overridable at runtime.

For a complete set of properties that can be used to control Quarkus/Hibernate behavior, see this guide

Upvotes: 30

Related Questions