【问题标题】:Filtering with P6SPY使用 P6SPY 过滤
【发布时间】:2009-08-26 15:38:27
【问题描述】:

有没有办法在 p6spy 中设置过滤器,使其只记录“插入/删除/更新”而不是“选择”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

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

【问题讨论】:

    标签: filtering p6spy


    【解决方案1】:

    答案的关键在 cmets

    # 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
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-01-20
      • 2018-02-25
      • 2013-07-18
      • 1970-01-01
      • 2019-07-04
      • 1970-01-01
      • 2018-12-14
      相关资源
      最近更新 更多