mirror of
https://github.com/keycloak/keycloak.git
synced 2026-01-25 16:42:34 +00:00
Enable logging of slow database operations
We consider db operations slower than 10s for now. Fixes #38863 Signed-off-by: Thomas Darimont <thomas.darimont@googlemail.com>
This commit is contained in:
@@ -124,6 +124,17 @@
|
||||
MSSQL returns the whole result at once.
|
||||
See https://docs.oracle.com/en/database/oracle/oracle-database/21/jjdbc/resultset.html -->
|
||||
<property name="hibernate.jdbc.fetch_size" value="64" />
|
||||
|
||||
<!-- We consider database statements taking longer than 10s as slow
|
||||
See https://docs.jboss.org/hibernate/orm/6.6/introduction/html_single/Hibernate_Introduction.html#slow-queries
|
||||
Note, that this requires the logger configuration: org.hibernate.SQL_SLOW:info
|
||||
-->
|
||||
<property name="hibernate.log_slow_query" value="10000"/>
|
||||
|
||||
<!-- Prepends the name or query text of the executed statement as comment to make it easier to identify slow queries
|
||||
See https://docs.jboss.org/hibernate/orm/6.6/introduction/html_single/Hibernate_Introduction.html#slow-queries
|
||||
-->
|
||||
<property name="hibernate.use_sql_comments" value="true"/>
|
||||
</properties>
|
||||
</persistence-unit>
|
||||
</persistence>
|
||||
|
||||
@@ -30,6 +30,9 @@ quarkus.log.category."io.quarkus.arc.processor.IndexClassLookupUtils".level=off
|
||||
quarkus.log.category."io.quarkus.hibernate.orm.deployment.HibernateOrmProcessor".level=warn
|
||||
quarkus.log.category."io.quarkus.deployment.steps.ReflectiveHierarchyStep".level=error
|
||||
|
||||
# Enable logging for slow queries
|
||||
quarkus.log.category."org.hibernate.SQL_SLOW".level=info
|
||||
|
||||
quarkus.transaction-manager.enable-recovery=true
|
||||
# Set default directory name for the location of the transaction logs
|
||||
quarkus.transaction-manager.object-store.directory=${kc.home.dir:default}${file.separator}data${file.separator}transaction-logs
|
||||
|
||||
Reference in New Issue
Block a user