修复Hibernate的警告

时间:2009-02-18 08:22:19

标签: hibernate warnings

我目前正在开发一个Hibernate项目。我目前的开发设置在启动时有很长的调试打印输出,来自很多休眠警告。 我想清理一下。

  

2009-02-18 09:14:19   org.hibernate.util.JDBCExceptionReporter   logWarnings警告:   [Microsoft] [SQLServer 2000驱动程序for   JDBC] [SQLServer]更改了语言   设置为us_english。

我如何解决这个问题?谷歌无法给我答案

  

2009-02-18 09:14:19 org.hibernate.util.JDBCExceptionReporter logWarnings   警告:SQL警告:0,SQLState:

我不明白。谁能解释一下?

  

2009-02-18 09:48:36 org.hibernate.util.JDBCExceptionReporter logWarnings   警告:[Microsoft] [用于JDBC的SQLServer 2000驱动程序] [SQLServer]将数据库上下文更改为“bess_test”。

如何指定数据库,以避免这种情况?

1 个答案:

答案 0 :(得分:2)

如果您想打开Hibernate特定部分的日志记录,将来可能会发现这有用。此配置还应隐藏您看到的警告。

# Hibernate logging
# Log everything (a lot of information, but very useful for troubleshooting)
log4j.logger.org.hibernate=FATAL
# Log all SQL DML statements as they are executed
log4j.logger.org.hibernate.SQL=INHERITED
# Log all JDBC parameters
log4j.logger.org.hibernate.type=INHERITED
# Log all SQL DDL statements as they are executed
log4j.logger.org.hibernate.tool.hbm2ddl=INHERITED
# Log the state of all entities (max 20 entities) associated with the session at flush time
log4j.logger.org.hibernate.pretty=INHERITED
# Log all second-level cache activity
log4j.logger.org.hibernate.cache=INHERITED
# Log all OSCache activity - used by Hibernate
log4j.logger.com.opensymphony.oscache=INHERITED
# Log transaction related activity
log4j.logger.org.hibernate.transaction=INHERITED
# Log all JDBC resource acquisition
log4j.logger.org.hibernate.jdbc=INHERITED
# Log all JAAS authorization requests
log4j.logger.org.hibernate.secure=INHERITED