使用log4j在SSH集成环境中追踪错误

insert  log4j.properties at  your project , such as the src/main/resource with :

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


log4j.rootLogger=info, stdout

log4j.logger.org.hibernate.tool.hbm2ddl=trace
log4j.logger.org.hibernate.testing.cache=debug

# SQL Logging - HHH-6833
log4j.logger.org.hibernate.SQL=debug

log4j.logger.org.hibernate.hql.internal.ast=debug

log4j.logger.org.hibernate.sql.ordering.antlr=debug

 then: restart your  sever  ,you will  see  the  better  debug  information 

it's very useful  when you  meet  some problems  when  there's  no  detailed  information  offered  by 

your  sever

of course , you  can  define your  debug level  by  redefining  this  file  with  the  help of  source code 

猜你喜欢

转载自497228829.iteye.com/blog/1926994