Reputation: 3664
i want to get hold of Mysql queries produced by grails before or after executing.
trainingList = PrivateTraining.findAll(query,parameter)
i want to print the complete mysql query which is executed by the above statement. is there anyway to print ?
Upvotes: 3
Views: 2407
Reputation: 1800
Set this property in your DataSource.groovy
:
hibernate.show_sql=true
Example:
environments {
development {
dataSource {
/* ---------------------- */
hibernate.show_sql = true
/* ---------------------- */
dbCreate = "update" // one of 'create', 'create-drop', 'update', 'validate', ''
url = "jdbc:mysql://localhost:3306/my-db"
// ...
Upvotes: 8
Reputation: 8842
Add the following to your logging configuration:
debug 'org.hibernate'
Upvotes: 1