We have WARN logs produced by Hibernate that are just noise for us.
Mainly:
WARN Batch containing %s statements could not be sorted (might indicate a circular entity relationship)
Because we have a few cases with a graph of entities. In reality the graph is a directed graph without any circularity, and I can’t understand why we get this log, but that’s another issue ( Jira ).ERROR o.h.e.j.s.SqlExceptionHelper: ERROR: deadlock detected\n Detail: Process 10486 waits for ShareLock on transaction 57845238; blocked by process 10509
These concurrency errors can happen while processing async messages, and they are not an issue for us because we have a retry mechanism to handle them.
How can we silence these specific logs without muting all the warnings/errors?
In a typical logging setup, they would be emitted by different loggers, and we could configure Logback to silence just those specific loggers. But in Hibernate/JBoss logging, they are all produced by a few loggers such as o.h.e.j.s.SqlExceptionHelper or org.hibernate.orm.jdbc.error.