-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Unable to turn off logging
PostPosted: Wed Jun 14, 2006 12:57 pm 
Newbie

Joined: Wed Jun 07, 2006 3:21 pm
Posts: 13
Need help with Hibernate? Read this first:

Hi ,
I have a very strange problem . The application uses a custom adaptor over logger over log4j . The configuration is dynamically set and is not using the config xml file . The application uses hibernate and hibernate starts to print out the log statements . I can understand that the hibernate logging will work as long as log4j is found in the classpath . I would like to know how do I turn off logging by hibernate in my programs( dynamically).Please note that I am not using the static config xml files or log4j.properties . I am using log4j 2.7 .



Hibernate version:

3.1.3

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Thanks ,
Arun


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 14, 2006 7:03 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
Using your root Logger object, get the org.hibernate Logger. Using that, call "getLoggerRepository().setThreshold(Level.ERROR);" to set the minimum log level for the entire hierarchy of logger at or below org.hibernate.

_________________
Code tags are your friend. Know them and use them.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 15, 2006 12:25 pm 
Newbie

Joined: Wed Jun 07, 2006 3:21 pm
Posts: 13
Thanks tenwit . It worked fine .


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 15, 2006 5:02 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
Ah, the power of javadocs. Don't forget to rate my javadoc-reading abilities by clicking a "Yes" link!

_________________
Code tags are your friend. Know them and use them.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.