Log queries with parameters in Hibernate 5 and 6

For debugging purposes it is often useful to log hibernate generated queries in your application.

In a Spring Boot application up to 2.7 using Hibernate 5.x, this can be achieved using the following configuration.

# log SQL statements
logging.level.org.hibernate.SQL=debug
# log SQL binding parameters to get the actual values of a query parameter
logging.level.org.hibernate.type.descriptor.sql=trace

In Hibernate 6.x used e.g. in Spring Boot 3.0 / 3.1 the parameter for the parameter output has changed. In order to acchive the same result as above, the following configuration is required.

# log SQL statements
logging.level.org.hibernate.SQL=debug
# log SQL binding parameters to get the actual values of a query parameter
logging.level.org.hibernate.orm.jdbc.bind=trace

In summary: for parameter logging up to Hibernate 5 you have to configure “org.hibernate.type.descriptor.sql” and for Hibernate 6 you have to use “org.hibernate.orm.jdbc.bind”

PostgreSQL pg_upgradecluster

If the version of a PostgreSQL server changes, it is required to upgrade the version manually. This can e.g. happen, if you do a release upgrade of your Linux distribution. The below description explains how to use PostgreSQL pg_upgradecluster to upgrade PostgreSQL 9.6 from Debian Stretch (Debian 9) to PostgreSQL 11 of Debian Buster (Debian 10).

Continue reading “PostgreSQL pg_upgradecluster”

Tomcat: split catalina_home and catalina_base

Introduction

Catalina_home is the tomcat installation (unzipped archive), catalina_base is the folder of a server instance. By default, catalina_base is set to catalina_home. But when it comes to upgrading Tomcat installation, having the possibility to roll back or to run more than one instance of Tomcat on the same server, it is easier to separate those two folders from each other. Continue reading “Tomcat: split catalina_home and catalina_base”