有没有办法在p6spy中设置过滤器,这样它只记录“insert / delete / update”而不是“select”SQL语句?
p6spy提及的文档: “P6Spy允许您监视特定的表或特定的语句类型”
他们给出的一个例子如下:
显示捕获所有内容的示例 选择语句,订单除外 表如下:
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
但这似乎不起作用。任何有任何建议的人?
答案 0 :(得分: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