Turn off unwanted Hibernate logging

Solution Verified - Updated -

Issue

  • User has a problem with logging in Hibernate . User gets the following log statements even though handling the error with a UserTransaction:
 WARN  [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (EJB default - 20) SQL Error: 0, SQLState: 23505
ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (EJB default - 20) 
2015-02-17 15:23:23,057 WARN  [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (EJB default - 20) SQL Error: 0, SQLState: 23505
2015-02-17 15:23:23,057 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (EJB default - 20) ERROR: 
2015-02-17 15:23:23,057 ERROR [org.hibernate.engine.jdbc.batch.internal.BatchingBatch] (EJB default - 20) HHH000315: Exception executing batch [could not perform addBatch]
  • How to turn off the logging programmatically? Is there an easy way to turn off the logging programmatically?
  • What is out best option? Is there a property in Hibernate for disabling this logging or just filter it with the logging framework?
  • What consequences can we foresee by disabling the logging?

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.2.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.