来自http://docs.jboss.org/hibernate/core/3.3/reference/en/html/session-configuration.html#configuration-logging
以下是记录器类别的列表:
Category Function
org.hibernate.SQL Log all SQL DML statements as they are executed
org.hibernate.type Log all JDBC parameters
org.hibernate.tool.hbm2ddl Log all SQL DDL statements as they are executed
org.hibernate.pretty Log the state of all entities (max 20 entities) associated with the session at flush time
org.hibernate.cache Log all second-level cache activity
org.hibernate.transaction Log transaction related activity
org.hibernate.jdbc Log all JDBC resource acquisition
org.hibernate.hql.ast.AST Log HQL and SQL ASTs during query parsing
org.hibernate.secure Log all JAAS authorization requests
org.hibernate Log everything (a lot of information, but very useful for troubleshooting)
格式化以粘贴到log4j XML配置文件中:
注意:大多数记录器使用DEBUG级别,但是org.hibernate.type使用TRACE。在以前的Hibernate版本中,org.hibernate.type也使用DEBUG,但是从Hibernate 3开始,您必须将级别设置为TRACE(或ALL),以便查看JDBC参数绑定日志记录。
并指定了这样的类别:
必须将其放在根元素之前。