Show hibernate query log in multitenant environment

Viewed 57

I am working on spring and hibernate based multi-tenant applications. I have one master-database and multiple tenant-database.

using below log4j.properties and hibernate properties I can see the query log executed on the database.

log4j.logger.org.hibernate=INFO,hb 
log4j.logger.org.hibernate.type=trace
log4j.logger.org.hibernate.SQL=debug 
log4j.logger.org.hibernate.type.descriptor.sql=trace

hibernate.show_sql=false
hibernate.format_sql=false

I did not specify any schema name in my all hibernate mapping class, schema selection done at runtime based on request

@Table(name = "tbl_user")
public class TblUser {
}

I have not specified schema due to this reason, I can not see any schema name in the query log. It shows only the table name. It is very difficult to distinguish which query executed in which database.

0 Answers
Related