Plugins You can find out about all the publicly available Grails plugins.

P6Spy UI Plugin

0 vote
compile ":p6spy-ui:0.1"

 Documentation  Source


P6Spy UI Plugin


grails install-plugin p6spy-ui


The P6Spy UI plugin uses the P6Spy library to intercept JDBC calls and display them in a web page. One benefit of P6Spy is that it will display the SQL that was actually run with SQL ? placeholders but also the SQL with the actual values.

Note that the plugin does not require the use of the Grails p6spy plugin and is actually incompatible with it. If you are currently using it, migrate your settings from to Config.groovy as described below and uninstall it.

The plugin comes with a controller and a GSP that will display the executed SQL in a DataTable and also graphs in a second tab (see the screenshots tab for examples).


The first thing you need to do is change the driverClassName property in DataSource.groovy for any environments that you want to use the plugin in. Change it to com.p6spy.engine.spy.P6SpyDriver - e.g.

dataSource {
   driverClassName = 'com.p6spy.engine.spy.P6SpyDriver'
   username = …
   password = …
   dbCreate = …
   url = …

Having done this, you need to tell P6Spy what the real driver is. You do not create a file like you usually do when working with P6Spy - instead you store settings in Config.groovy. This is more convenient since the plugin has many default values already set, so you only need to set the values that are required (currently just "realdriver") and any overrides or other values that don't have defaults set. In addition you can also externalize properties and take advantage of other features of setting properties in Config.groovy.

The current default values are:

appender = 'grails.plugin.p6spy.ui.MemoryLogger'
module.log = 'com.p6spy.engine.logging.P6LogFactory'
deregisterdrivers = true
executionthreshold = ''
outagedetection = false
outagedetectioninterval = ''
filter = false
include = ''
exclude = ''
sqlexpression = ''
autoflush = true
includecategories = ''
excludecategories = 'info,debug,result,batch'
stringmatcher = ''
stacktrace = false
stacktraceclass = ''
reloadproperties = false
reloadpropertiesinterval = '60'
useprefix = false

Release history

  • 11/11/2012 Initial 0.1 release