记录休眠配置详细信息

时间:2014-01-28 20:22:37

标签: hibernate logging

Java Persistence in Hibernate提到可以修改日志记录属性以显示Hibernate的额外配置细节:

Ejb3Configuration:141
- Trying to find persistence unit: helloworld
Ejb3Configuration:150
- Analyse of persistence.xml:
file:/helloworld/build/META-INF/persistence.xml
PersistenceXmlLoader:115
- Persistent Unit name from persistence.xml: helloworld
Ejb3Configuration:359
- Detect class: true; detect hbm: true

以下是我的$APP\my-jph-example\src\main\resources\log4j.properties

# direct log messages to stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE}
    %5p %c{1}:%L - %m%n

#Root logger option
log4j.rootLogger=ERROR, stdout

#Hibernate logging options (INFO only shows startup messages)
log4j.logger.org.hibernate=DEBUG

#Log JDBC bind parameter runtime arguments
log4j.logger.org.hibernate.type=INFO

尽管有上述配置,但我没有看到任何额外的日志记录详细信息。

请注意,我根据Hibernate docs设置了org.hibernate

如何修改此log4j.properties文件以显示Hibernate的额外配置详细信息?另外,我询问有关记录SQL语句的信息。

0 个答案:

没有答案
相关问题