Dashboard > SakaiPedia > ... > Database Administration > Hibernate Administration
  SakaiPedia Log In | Signup View a printable version of the current page.  
  Hibernate Administration
Added by Mark J. Norton, last edited by Mark J. Norton on Oct 06, 2006  (view change)
Labels: 
(None)

Enable Log Messages - Glenn Golden

The following Sakai property,

  • hibernate.show_sql=true

will enable hibernate messages, showing the statements being processed, like this:

Hibernate: insert into SAM_ITEMGRADING_T (ASSESSMENTGRADINGID,  PUBLISHEDITEMID, PUBLISHEDITEMTEXTID, AGENTID, 
SUBMITTEDDATE,  PUBLISHEDANSWERID, RATIONALE, ANSWERTEXT, AUTOSCORE, OVERRIDESCORE,  COMMENTS, GRADEDBY, GRADEDDATE, 
REVIEW, ATTEMPTSREMAINING,  LASTDURATION) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

But these don't include the values for the "?"s.

Josh Holtzman adds,

I think adding debug logging for org.hibernate.type will print out the parameter bindings.

Aaron Zeckoski adds,

This is the right way to do it. If you are looking for docs, check here

see section 3.5

Here is a copy and paste of the important info:

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)

When developing applications with Hibernate, you should almost always work
with debug enabled for the category org.hibernate.SQL, or, alternatively,
the property hibernate.show_sql enabled.

Site running on a free Atlassian Confluence Open Source Project License granted to Sakai Foundation. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.5 Build:#811 Jul 25, 2007) - Bug/feature request - Contact Administrators