Don't log duplicate key exceptions as an ERROR
Description
Activity

Jonathan AmirJanuary 7, 2010 at 3:13 PM
Bug 3731 seems to be the same as this one. Regarding Gavin's comment, unfortunately it is not possible to suppress this logger category, it is a solution that is too extreme because the message is logged at level ERROR. Please see details at the other bug report.

Jeantine Michelle MankelowJune 22, 2005 at 7:09 AM
I'm not sure I understand what you mean by "we just don't really "know" enough about the nature of the sql exception to not log it.". Your code logs this error and then throws an exception which my application handles. Since this is a recoverable exception it shouldn't be logged as an "ERROR"
I could turn down logging on the org.hibernate.util.JDBCExceptionReporter to only log FATAL errors but that seems a bit of an extreme solution.

GavinGJune 22, 2005 at 6:15 AM
Sorry, we just don't really "know" enough about the nature of the sql exception to not log it.
You can always supress logging on that category using log4j.

Jeantine Michelle MankelowJune 21, 2005 at 8:37 AM
This is the error we are seeing in the log:
2005-06-21 18:17:37,884 ERROR [org.hibernate.util.JDBCExceptionReporter] - <Duplicate entry 'Payment Method Summary' for key 2>

Max Rydahl AndersenJune 20, 2005 at 7:43 AM
without any concrete examples we cant know which you are talking about.
There is a few exceptions we log since they are pretty vital for bug hunting in use of hibernate.
Details
Assignee
UnassignedUnassignedReporter
Jeantine Michelle MankelowJeantine Michelle MankelowPriority
Minor
Details
Details
Assignee
Reporter

Hibernate is logging duplicate key exceptions logged as ERROR.
Our application handles errors of this kind and turns them into validation messages for the user, as I imagine is the case for many other applications.
It is a concern for us that this appears in the log as an error when it is not, it may cause undue concern for our clients, at the very least it will clutter the log. We would rather this type of exception is not logged, or at the very least should be scaled down to the INFO or WARNING class.