问题
I am planning to use P6Spy to intercept database statements within our architecture. However, I noticed on the P6Spy website that the last release of the software was back in 2003. Is there anything out there that is better or should I just stick with P6Spy?
回答1:
We still use P6Spy with our Weblogic 8.1.5 with EJB2.0 and it works charms. I'm about to try and integrate it with Weblogic 10.3 and EJB3.0
回答2:
P6Spy has been under active development ago for a while now. The 2.0 version has also just been released. It now supports use without any configuration file for some use cases. It has also been updated to the JDBC 4.0 API and is fully compatible is Java 6 & 7.
The project is also being developed on GitHub now. Updated documentation is available as well.
回答3:
Some other tools and libraries that are similiar to P6Spy.
Craftsman Spy appears to overlap quite a bit with the feature set in log4jdbc. This library hasn't been updated in 2 years and depends on Jakarta Commons Logging.
JAMon (Java Application Monitor) is a comprehensive application monitor and monitoring API which includes JDBC/SQL monitoring as part of it's very large feature set.
JdbcProxy The driver can also emulate another JDBC driver to test the application without a database.
LogDriver appears to be similiar to log4jdbc and the author has written a nice article on JDBC logging in general and his motivation and experience of writing LogDriver.
yet another JDBC logger
log4jdbc-remix an experimental fork of log4jdbc with some interesting features.
jdbcdslog Another new jdbc wrapper with a lot of crossover with log4jdbc features.
SqlRecorder A library that is a wrapper around a JDBC driver to record all executed queries to different locations like a file,console or any other remote server via plugins.
log4jdbc-log4j2 Another fork of log4jdbc that includes the log4jdbc-remix fork and other features of it's own.
Source: https://code.google.com/archive/p/log4jdbc/
回答4:
I started using log4jdbc when p6spy wouldn't work on a precompile project that did its own driver discovery. log4jdbc has you change the DB connection url which we found simpler to setup. It also doesn't require a separate configuration file (spy.properties) and it is actively worked on. I'm not going to touch p6spy again.
来源:https://stackoverflow.com/questions/797076/anything-better-than-p6spy