Pretty much everything in the question. I just discovered p6spy in association with hibernate which is really cool to see the actual sql queries, though I'm quite baffled on how it works.
So how does it work?
the basic idea on p6spy goes like this:
Datasource
or for JDBC driver
in your code,
what you do is instead of referring the real ones, you specify p6spy
specific ones: com.p6spy.engine.spy.P6SpyDriver
or com.p6spy.engine.spy.P6DataSource
respectively (for full documentation, see: p6spy.readthedocs.io/en/latest/configandusage.html).spy.properties
file (using realdriver
or realdatasource
properties respectively)com.p6spy.engine.logging.P6LogFactory
)appender=com.p6spy.engine.logging.appender.FileLogger
), stdout logger (using appender=com.p6spy.engine.logging.appender.StdoutLogger
) or log4j logger (using: appender=com.p6spy.engine.logging.appender.Log4jLogger
)If interested in more details, feel free to ask, or check the project itself on: https://github.com/p6spy/p6spy
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With