My Quotes


When U were born , you cried and the world rejoiced
Live U'r life in such a way that when you go
THE WORLD SHOULD CRY






Thursday, April 4, 2013

Useful Debugging parameters for Hibernate via Log4j

### Hibernate logging configuration ### 

### Log everything (a lot of information, but very useful for troubleshooting) ### 
#log4j.logger.org.hibernate=info 

### Log HQL and SQL ASTs during query parsing ### 
log4j.logger.org.hibernate.hql.ast.AST=DEBUG, SQL_APPENDER 
log4j.additivity.org.hibernate.hql.ast.AST=false 

### log just the SQL 
log4j.logger.org.hibernate.SQL=DEBUG, SQL_APPENDER 
log4j.additivity.org.hibernate.SQL=false 

### log JDBC bind parameters. Very userfull, when debug parameterized queries ### 
log4j.logger.org.hibernate.type=TRACE, SQL_APPENDER 
log4j.additivity.org.hibernate.type=false 

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

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

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

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

### Log all 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 

log4j.appender.SQL_APPENDER=org.apache.log4j.RollingFileAppender 
log4j.appender.SQL_APPENDER.File=c\:/EC_sql.log
log4j.appender.SQL_APPENDER.MaxFileSize=1000KB 
log4j.appender.SQL_APPENDER.MaxBackupIndex=62 
log4j.appender.SQL_APPENDER.layout=org.apache.log4j.PatternLayout 
log4j.appender.SQL_APPENDER.layout.ConversionPattern=[%d] %5p [%t] (%F:%L) - %m%n

No comments :