对spring和hibernate的bean单独设置为debug.
例如log包下checkServiceImp设置为debug级别:
在代码中加入:
Logger log=Logger.getLogger(this.getClass().getName());
if(log.isInfoEnabled()){log.info("This is debug.");} 在log4j.properties中加入:
log4j.logger.log.checkServiceImp=DEBUG, stdout不知道能否帮到LZ
例如log包下checkServiceImp设置为debug级别:
在代码中加入:
Logger log=Logger.getLogger(this.getClass().getName());
if(log.isInfoEnabled()){log.info("This is debug.");} 在log4j.properties中加入:
log4j.logger.log.checkServiceImp=DEBUG, stdout不知道能否帮到LZ
这个是设置 hibernate 的# All hibernate log output of "info" level or higher goes to stdout.
# For more verbose logging, change the "info" to "debug" on the last line.
log4j.logger.org.hibernate.ps.PreparedStatementCache=WARN
log4j.logger.org.hibernate=WARN# Changing the log level to DEBUG will result in Hibernate generated
# SQL to be logged.
log4j.logger.org.hibernate.SQL=ERROR# Changing the log level to DEBUG will result in the PreparedStatement
# bound variable values to be logged.
log4j.logger.org.hibernate.type=ERROR
这个是 Spring 的:
log4j.logger.org.springframework=WARN