Joined: Fri Aug 17, 2007 1:45 pm Posts: 9
|
I have a question about logging to a file log with hibernate 3.1 in a web application.
Please I need to know how to configure the log4j.properties and my apache tomcat web container to logging all the sql statements executed by hibernate to log file that I could see later.
this is my log4.properties configuration:
### direct log messages to stdout ### log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.Target=test 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' ###
### direct messages to file hibernate.log ### log4j.appender.file=org.apache.log4j.FileAppender log4j.appender.file.File=hibernate.log log4j.appender.file.layout=org.apache.log4j.PatternLayout log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
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
### 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 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
I hope you can help me.
Greetings
Ariel
|
|