I'm trying to use p6spy for logging outage sql-statement. Based on official doc (http://p6spy.readthedocs.io/en/latest/index.html) I can do it by set specific properties in spy.properties file such as outagedetection and outagedetectioninterval. I set outagedetection value in 'true' and outagedetectioninterval in '1' and I thought that I saw only the statements with execution time more than 1 second in my result spy.log file, but I got unexpected result :( - I saw all sql-statement in spite of outage-properties I've set. Has anybody faced with such problem?
We use hibernate 5 + spring boot + h2 db + maven. For using p6spy i've done the following configuration.
Add dependency in pom.xml enter image description here
In official doc of p6spy (http://p6spy.readthedocs.io/en/latest/configandusage.html#common-property-file-settings) i got the spy.property and leave only the properties i needed. The result in the code below (i deleted some commented lines for readability): enter image description here
Changed my application.yml next way:
- change url and app :p6spy postfix after jdbc.
- set driverClassName property. The result in the code below: enter image description here