-->
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.  [ 3 posts ] 
Author Message
 Post subject: how to set DEBUG log level in Hibernate ?
PostPosted: Fri Mar 17, 2006 3:14 am 
Regular
Regular

Joined: Wed Mar 08, 2006 2:07 am
Posts: 50
Location: Bangalore
I want to switch on the DEBUG level logging for my hibernate app. But i dont know how to switch it on ?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 17, 2006 3:48 am 
Regular
Regular

Joined: Wed Jul 27, 2005 2:33 am
Posts: 118
Which version Hibernate are you using? If it's Hibernate2.x then in the log4j.xml, add the following:

Code:
<category name="net.sf.hibernate">
    <priority value="DEBUG"/>
</category>

If you are using Hibernate3.x, then in the log4j.xml add the following:

Code:
<category name="org.hibernate">
    <priority value="DEBUG"/>
</category>


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 17, 2006 7:43 am 
Newbie

Joined: Thu Mar 16, 2006 4:20 am
Posts: 3
Location: Sydney
If you are using Java 1.4 built in logging you would add the following to a logging property file -

org.hibernate.SQL.level = INFO
org.hibernate.type.level = INFO
org.hibernate.tool.hbm2ddl.level = INFO

or alternatively just
org.hibernate = INFO

where INFO can be changed for FINE, FINER or FINEST.
(watch out - console logging by default will only show INFO level)

To find more out about the rest of your logging property file and how to use this custom file see -

[url]http://java.sun.com/j2se/1.4.2/docs/api/java/util/logging/LogManager.html
[/url]


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.