I am writing a project with JAX-RS and Hibernate, using ECLIPSE IDE (No Maven). For Hibernate I am using the below Packages:
hibernate version 4.3.1 Final
For Logging i am using Log4J
and its working fine, but for all Hibernate related logs it's printing the debug messages like thousands of then, I will paste some of the Log messages below.
The Log4J is not getting utilized for the hibernate internal configurations. As read per documentation to utilize the Log4J for Logging instead of Simple SLF logger, I have the below jars in the class path:
- slf4j.api-1.6.1
- slf4j-log4j12-1.6.1
- log4j-1.2.17.
Even after adding the above jar files its still printing all the tons of DEBUG messages, I do not know if I missed some step to eliminate the logs coming from hibernate initializations.
I want to eliminate all the additional logs from the hibernate jar's and use only my Log4J settings to log the messages.
I am using eclipse IDE and not Maven or pom file.
Here are the additional information:
Log4J Properties:
log4j.rootLogger=ERROR, stdout
log4j.logger.org.hibernate=ERROR
log4j.logger.org.hibernate.hql.ast.AST=INFO
Hibernate config:
<property name="connection.datasource">Test</property>
<property name="connection.pool.size">1</property>
<property name="dialect">org.hibernate.dialect.OracleDialect</property>
<property name="connection.autocommit">false</property>
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
<property name="show_sql">false</property>
<mapping resource="DBMappingOracle.hbm.xml" />
and dbmapping file has
<class name="com.text.model.IssueType" table="ISSUE_TYPE">
<id name="issueTypeID" column="ISSUE_ID" type="int" />
<property name="id" column="CATEGORY_ID" type="int" />
<property name="issuename" column="ISSUE_NAME" type="string" />
<property name="issueDesc" column="ISSUE_DESC" type="string" />
</class>
Here is the session code:
Configuration cfg = new Configuration();
cfg.configure("hibernate.cfg.xml");
SessionFactory sf = cfg.buildSessionFactory();
Session session = sf.openSession();
DEBUG MESSAGES i SEE, like 1000's of them like below ones.
//2354 [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] //DEBUG org.hibernate.hql.internal.ast.ErrorCounter - throwQueryException() : no errors
//2354 [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] //DEBUG org.hibernate.hql.internal.ast.ErrorCounter - throwQueryException() : no errors
//2363 [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] //DEBUG org.hibernate.hql.internal.ast.QueryTranslatorImpl - HQL: From //com.ejgallo.distributor.claims.model.IssueSubType
//2363 [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] //DEBUG org.hibernate.hql.internal.ast.QueryTranslatorImpl - HQL: From //com.ejgallo.distributor.claims.model.IssueSubType
//2363 [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] //DEBUG org.hibernate.hql.internal.ast.QueryTranslatorImpl - SQL: select //issuesubty0_.ISSUE_SUBTYPE_ID as ISSUE_SU1_3_, issuesubty0_.ISSUE_ID as ISSUE_ID2_3_, //issuesubty0_.ISSUE_SUBTYPE_NAME as ISSUE_SU3_3_, issuesubty0_.ISSUE_SUBTYPE_DESC as //ISSUE_SU4_3_ from ISSUE_SUBTYPE issuesubty0_
//2363 [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)']