5
几乎所有的问题。我只是发现了与hibernate相关的p6spy,看到实际的sql查询真的很酷,尽管我对它的工作原理感到困惑。
那么它是如何工作的?P6SPY如何工作?
几乎所有的问题。我只是发现了与hibernate相关的p6spy,看到实际的sql查询真的很酷,尽管我对它的工作原理感到困惑。
那么它是如何工作的?P6SPY如何工作?
上P6SPY的基本思路是这样的:
Datasource
或代码中的JDBC driver
, 你做的是什么,而不是指真正的,你指定P6SPY 特定的人:com.p6spy.engine.spy.P6SpyDriver
或com.p6spy.engine.spy.P6DataSource
(有关完整文档,请参阅:p6spy.readthedocs.io/en/latest/configandusage.html)。spy.properties
文件以假乱真(分别使用realdriver
或realdatasource
属性)com.p6spy.engine.logging.P6LogFactory
)实现SQL语句的记录appender=com.p6spy.engine.logging.appender.FileLogger
),stdout记录器(使用appender=com.p6spy.engine.logging.appender.StdoutLogger
)或log4j记录器(使用:appender=com.p6spy.engine.logging.appender.Log4jLogger
)如果有兴趣在更多的细节,随便问,或检查项目本身:https://github.com/p6spy/p6spy
你有这方面的任何sugesstion http://stackoverflow.com/q/31337283/413032 –