當前位置:編程學習大全網 - 網站源碼 - 如何關閉hibernate產生的大量日誌

如何關閉hibernate產生的大量日誌

要關閉hibernate的日誌,首先要把hibernate.show_sql設置為false;然後設置log4j.properties。

# Control logging for other open source packages

log4j.logger.com.opensymphony.oscache=ERROR

log4j.logger.net.sf.navigator=ERROR

log4j.logger.net.sf.acegisecurity=WARN

log4j.logger.net.sf.acegisecurity.intercept.event.LoggerListener=WARN

log4j.logger.org.apache.commons=ERROR

log4j.logger.org.apache.struts=WARN

log4j.logger.org.displaytag=ERROR

log4j.logger.org.springframework=WARN

log4j.logger.com.ibatis.db=WARN

log4j.logger.org.apache.velocity=WARN

# Don't show debug logs for WebTest

log4j.logger.com.canoo.webtest=WARN

# 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

  • 上一篇:友威YW9000的播放
  • 下一篇:簡單的銷售源代碼
  • copyright 2024編程學習大全網