iamjerryyeung

Sunday, April 22, 2012

hibernate debugging

show_sql,
format_sql
use log4j.properties, org.hibernate-> DEBUG, org.hibernate.type->FINE or use P6Spy to snoop JDBC connection

# 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
 
# Root logger option
log4j.rootLogger=INFO, stdout
 
# Hibernate logging options (INFO only shows startup messages)
log4j.logger.org.hibernate=INFO
 
# Log JDBC bind parameter runtime arguments
log4j.logger.org.hibernate.type=trace
 
http://www.mkyong.com/hibernate/how-to-display-hibernate-sql-parameter-values-log4j/
 
http://www.mkyong.com/hibernate/how-to-configure-log4j-in-hibernate-project/ 

0 Comments:

Post a Comment

<< Home