3

Every time I launch my Java on Eclipse, it floods the console with logging information:

Jun 10, 2014 2:34:01 AM org.hibernate.annotations.common.Version <clinit>
INFO: HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
Jun 10, 2014 2:34:01 AM org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {4.0.0.Final}
Jun 10, 2014 2:34:01 AM org.hibernate.cfg.Environment <clinit>
INFO: HHH000206: hibernate.properties not found
Jun 10, 2014 2:34:01 AM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : javassist
Jun 10, 2014 2:34:01 AM org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
INFO: HHH000402: Using Hibernate built-in connection pool (not for production use!)
Jun 10, 2014 2:34:01 AM org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
INFO: HHH000115: Hibernate connection pool size: 20
Jun 10, 2014 2:34:01 AM org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure

[another similar ~60 lines follow]

So far, I've tried (based on answer here How do you configure logging in Hibernate 4 to use SLF4J and "official" docs):

System.setProperty("org.jboss.logging.provider", "jdk");
java.util.logging.Logger.getLogger("org.hibernate").setLevel(Level.OFF);

But it makes no difference. Hibernate keeps spamming the console.

Turning off hibernate logging console output has been of no use, since as noted in the comments Hibernate 4+ uses JBOSS logging.

Community
  • 1
  • 1
MBlanc
  • 1,773
  • 15
  • 31

1 Answers1

1
To use JBoss Logging with Log4j, the log4j jar would also need to be available on the classpath.

To use JBoss Logging with Log4j2, the log4j2 jar would also need to be available on the classpath.

To use JBoss Logging with Slf4j, the slf4j-api jar would also need to be available on the classpath plus any needed slf4j backend.

The above quote from http://docs.jboss.org/hibernate/orm/4.3/topical/html/logging/Logging.html
so if you use log4j , you can added log4j jar to classpath,and using log4j config to control log output.

Vito
  • 1,080
  • 9
  • 19
  • You can also use Logback replace JBoss Logging. need slf4j-api,logback-core,logback-classic and logback.xml ;) – Vito Jun 10 '14 at 02:14
  • Thanks for answering, but I actually want to **disable** the logging since it clutters `stderr`. – MBlanc Jun 10 '14 at 19:29