且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

禁止休眠的INFO消息

更新时间:2023-10-20 13:34:52

我认为现在您必须为Hibernate添加配置,我使用

I think now you have now to add the configuration for Hibernate, I use

log4j.logger.org.hibernate=WARN
# use this to not see the [deprecated DTD] message from Hibernate 
log4j.logger.org.hibernate.orm.deprecation=ERROR
# use this to not see the "no cache configuration" warning
log4j.logger.org.hibernate.cache.ehcache.AbstractEhcacheRegionFactory=ERROR
# This is very important, otherwise db creation errors go silent
log4j.logger.org.hibernate.tool.hbm2ddl=DEBUG

啊,我现在看到您已经使用ERROR作为root记录程序级别,因此也许您的配置文件没有被读取,您正在使用哪个版本的Hibernate?

ah I see now you already use ERROR as root logger level so maybe your configuration file is not being read, which version of Hibernate are you using ?

也许您在类路径中还有另一个日志库,例如JBoss LogManager或Log4j 2?在这种情况下,可以代替Log4j来获取它们

Maybe you have an other log library in the classpath like JBoss LogManager or Log4j 2 ? In that case they might be picked up in place of Log4j