I am using Hibernate for a small demo project. I use Eclipse and I run the program from Eclipse, which outputs the program output to the Eclipse console.
This is a simple Java project, without Maven, no Spring, nothing. I just added the necessary hibernation libraries to my build path, which also includes jboss -logging-3.1.0.GA (which includes some of the log4j classes, so I assume log4j works here).
There are many people asking this question on the Internet, but none of the suggested solutions work for me.
I created the log4j.properties file inside the src directory of my project (so it will definitely be on the class path). The log4j.properties file is copied to the Eclipse bin directory when the project is built. It contains one line:
log4j.logger.net.sf.hibernate=fatal
which I found on the Internet. I also tried using
log4j.logger.org.hibernate=fatal
which doesn't help either.
However, I get the following console output, which is all informational messages (which should not appear since I set the severity to fatal ...):
21.11.2012 19:53:51 org.hibernate.annotations.common.Version <clinit> INFO: HCANN000001: Hibernate Commons Annotations {4.0.1.Final} 21.11.2012 19:53:51 org.hibernate.Version logVersion INFO: HHH000412: Hibernate Core {4.1.8.Final} 21.11.2012 19:53:51 org.hibernate.cfg.Environment <clinit> INFO: HHH000206: hibernate.properties not found 21.11.2012 19:53:51 org.hibernate.cfg.Environment buildBytecodeProvider INFO: HHH000021: Bytecode provider name : javassist 21.11.2012 19:53:51 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure INFO: HHH000402: Using Hibernate built-in connection pool (not for production use!) 21.11.2012 19:53:51 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure INFO: HHH000115: Hibernate connection pool size: 20 21.11.2012 19:53:51 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure INFO: HHH000006: Autocommit mode: true 21.11.2012 19:53:51 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure INFO: HHH000401: using driver [com.mysql.jdbc.Driver] at URL [jdbc:mysql:
I also tried adding -Dlog4j.configuration = log4j.properties VM arguments to my Eclipse startup configuration. Doesn't help anyway ...
user519499
source share