Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

quarkus

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?

like image 931
geoand Avatar asked Jan 23 '26 18:01

geoand


1 Answers

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

like image 172
geoand Avatar answered Jan 26 '26 23:01

geoand