0

我正在开发使用 Hibernate 3 的 Java 桌面应用程序。一切正常,但是当我运行我的应用程序时,我的输出充满了如下行:

mar 20, 2013 8:26:07 PM org.hibernate.cfg.annotations.Version <clinit>
INFO: Hibernate Annotations 3.3.1.GA
mar 20, 2013 8:26:07 PM org.hibernate.cfg.Environment <clinit>
INFO: Hibernate 3.2.5
mar 20, 2013 8:26:07 PM org.hibernate.cfg.Environment <clinit>
INFO: hibernate.properties not found
mar 20, 2013 8:26:07 PM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: Bytecode provider name : cglib
mar 20, 2013 8:26:07 PM org.hibernate.cfg.Environment <clinit>
INFO: using JDK 1.4 java.sql.Timestamp handling
mar 20, 2013 8:26:07 PM org.hibernate.ejb.Version <clinit>
INFO: Hibernate EntityManager 3.3.2.GA
mar 20, 2013 8:26:08 PM org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: persistence.Document
mar 20, 2013 8:26:08 PM org.hibernate.cfg.annotations.QueryBinder bindQuery
INFO: Binding Named query: Document.findAll => SELECT d FROM Document d
mar 20, 2013 8:26:08 PM org.hibernate.cfg.annotations.QueryBinder bindQuery
INFO: Binding Named query: Document.findById => SELECT d FROM Document d WHERE d.id = :id
mar 20, 2013 8:26:08 PM org.hibernate.cfg.annotations.QueryBinder bindQuery
INFO: Binding Named query: Document.findByUrl => SELECT d FROM Document d WHERE d.url = :url
mar 20, 2013 8:26:09 PM org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity persistence.Document on table DOCUMENTS
mar 20, 2013 8:26:09 PM org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: persistence.LanguageEntry
mar 20, 2013 8:26:09 PM org.hibernate.cfg.annotations.QueryBinder bindQuery
INFO: Binding Named query: LanguageEntry.findAll => SELECT l FROM LanguageEntry l
mar 20, 2013 8:26:09 PM org.hibernate.cfg.annotations.QueryBinder bindQuery
INFO: Binding Named query: LanguageEntry.findById => SELECT l FROM LanguageEntry l WHERE l.id = :id

我怎样才能禁用它?将非常感谢任何建议。

4

2 回答 2

1

请参阅下面的先前答案:

无法禁用休眠日志消息

看起来就像在运行时向 java 命令行添加 -Dlog4j.debug 选项一样简单。

于 2013-03-20T19:36:20.897 回答
1

尝试放入 hibernate.show_sql = false休眠属性

于 2013-03-20T19:41:45.153 回答