如何在InteliJ Idea中抑制hibernate消息?
INFO: HHH000204: Processing PersistenceUnitInfo [
name: persistenceUnit
...]
січ. 26, 2018 3:57:34 PM org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {5.1.0.Final}
січ. 26, 2018 3:57:34 PM org.hibernate.cfg.Environment <clinit>
INFO: HHH000206: hibernate.properties not found
січ. 26, 2018 3:57:34 PM org.hibernate.cfg.Environment buildBytecodeProvider
在persistence.xml
中尝试了这些选项而没有结果。
<property name="org.hibernate.jpa.internal.util.LogHelper.level" value="error"/>
<property name="org.hibernate.jpa.internal.util.LogHelper" value="error"/>
<property name="java.util.logging.Logger.org.hibernate" value="error"/>
<property name="java.util.logging.Level" value="error"/>
<property name="org.hibernate.logging.level" value="error"/>
<property name="org.hibernate" value="error"/>
<property name="org.hibernate.level" value="error"/>
<property name="org.hibernate.internal.log" value="error"/>
<property name="log4j.logger.org.hibernate" value="error"/>
<property name="log4j.rootLogger" value="error"/>
<property name="hibernate.logging.parameters" value="false"/>
<property name="hibernate.sql" value="error"/>
答案 0 :(得分:0)
如果您使用log4j等日志库,则可以在配置文件中添加以下行 -
<logger name="org.hibernate">
<level value="info"/>
</logger>
您还可以从hibernate配置文件中禁用 hibernate.show_sql 选项