-->
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.  [ 2 posts ] 
Author Message
 Post subject: Can't get [DEBUG] of Hibernate
PostPosted: Wed Feb 22, 2006 4:10 pm 
Newbie

Joined: Fri Oct 14, 2005 3:47 pm
Posts: 5
Location: Israel
Hibernate version:3.0.5
Spring version:1.2.5

I work with Spring and Hibernate and I don't succeed in getting DEBUG messages of Hibernate. I sure that my log4j.properties file there is in the right directory, log4j.jar and common-logging.jar there are in the classpath.
Also I use log4j logger for my application messages.

In applicationContext.xml of Spring I set
<prop key="hibernate.show.sql">true</prop>

I use Eclipse and in console I get only the [INFO] messages of Spring in red color.

Here is my log4j.properties file:
### direct log messages to stdout ###
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n

### set log levels - for more verbose logging change 'info' to 'debug' ###

log4j.rootLogger=debug, stdout

#log4j.logger.org.hibernate=info
log4j.logger.org.hibernate=DEBUG

### log HQL query parser activity
log4j.logger.org.hibernate.hql.ast.AST=debug

### log just the SQL
log4j.logger.org.hibernate.SQL=debug

### log JDBC bind parameters ###
#log4j.logger.org.hibernate.type=info
log4j.logger.org.hibernate.type=debug

### log schema export/update ###
log4j.logger.org.hibernate.tool.hbm2ddl=debug

### log HQL parse trees
#log4j.logger.org.hibernate.hql=debug

### log cache activity ###
log4j.logger.org.hibernate.cache=debug

### log transaction activity
log4j.logger.org.hibernate.transaction=debug

### log JDBC resource acquisition
log4j.logger.org.hibernate.jdbc=debug

### enable the following line if you want to track down connection ###
### leakages when using DriverManagerConnectionProvider ###
#log4j.logger.org.hibernate.connection.DriverManagerConnectionProvider=trace


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 22, 2006 6:40 pm 
Regular
Regular

Joined: Fri Oct 01, 2004 2:19 am
Posts: 111
Location: Melbourne, Australia
Dimka,

From memory, the proprty used to show SQL statements is
hibernate.show_sql, not hibernate.show.sql

_________________
Cheers,

Bonny

please don't forget to rate :)


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