• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hibernate logging problem

 
David Spades
Ranch Hand
Posts: 348
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wanted to see what the exact SQL statement issued by hibernate.
I've done the following:

1. put p6spy.jar into my build path
2. point data source to p6spy driver in my spring config
3. put spy.properties in root classpath containing one line only (realdriver)

but nothing changed. the parameters are still displayed as question marks. what's wrong?
thanks
 
Wayan Saryada
Ranch Hand
Posts: 105
IntelliJ IDE MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you can log the JDBC bind parameter by using the following configuration in the log4j.properites

log4j.logger.org.hibernate.type=trace
 
David Spades
Ranch Hand
Posts: 348
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd like to use p6spy because if I have lots of parameters, then it would be very difficult to determine which value goes to which parameter. thanks
 
David Spades
Ranch Hand
Posts: 348
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
okay, got it working. apparently you just need to restart the PC. dunno why, but it works now. But now, I got 2 more problems:
1. How do I exclude those resultsets from being logged. It's really cluttering my log files
2. How do I log only the effective SQL?
thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic