1

「挿入/削除/更新」のみをログに記録し、「選択」SQLステートメントをログに記録しないように、p6spyでフィルターを設定する方法はありますか?

p6spy のドキュメント: 「P6Spy を使用すると、特定のテーブルまたは特定のステートメント タイプを監視できます」

彼らが挙げた例は次のとおりです。

orders テーブルを除くすべての select ステートメントのキャプチャを示す例を次に示します。

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 に答える