1

有没有办法在 p6spy 中设置过滤器,这样它只记录“插入/删除/更新”而不是“选择”SQL 语句?

p6spy 的文档提到:“P6Spy 允许您监视特定的表或特定的语句类型”

他们给出的一个例子如下:

以下示例显示了所有 select 语句的捕获,但 order 表除外:

filter = true
# comma separated list of tables to include
include = select
# comma separated list of tables to exclude
exclude = orders

所以我想,必须有一种方法来包含插入、删除、更新和排除选择......因此,我准备了我的属性文件,如下所示:

filter = true
# comma separated list of tables to include
include = insert,update,delete
# comma separated list of tables to exclude
exclude = select

但这似乎不起作用。有人有什么建议吗??

4

1 回答 1

1

答案的关键在评论里

# comma separated list of tables to include
include = select

select是表的名称,而不是语句的类型。似乎不可能轻松地按语句类型(至少按select/ update/ )进行过滤。delete你可以通过使用来做到这一点

# sql expression to evaluate if using regex filtering
sqlexpression=

#allows you to use a regex engine or your own matching engine to determine
#which statements to log
stringmatcher=com.p6spy.engine.common.GnuRegexMatcher
于 2010-09-02T12:51:46.913 回答