LoginSignup
2

More than 3 years have passed since last update.

posted at

RDS for PostgreSQLでのログ出力について

はじめに

ログ出力上、関係するパラメータグループの項目にlog_statementlog_min_duration_statementがあると思います。
この関連がいまいち理解できていなかったので、確認のためにまとめました。

早見表

log_statement log_min_duration_statement 出力内容
none - ログ出力なし
- -1以外の数値 指定された値を上回る実行時間を要したクエリ、および実行時間がログに出力
none -1以外の数値 log_min_duration_statementに有効な値を指定されている場合は、ログにクエリが出力
all -1以外の数値 log_statementが出力したクエリはlog_min_duration_statementの出力には含まれない

参考リンク

https://docs.aws.amazon.com/ja_jp/AmazonRDS/latest/UserGuide/USER_LogAccess.Concepts.PostgreSQL.html

https://www.postgresql.jp/document/9.6/html/runtime-config-logging.html#guc-log-statement

https://www.postgresql.jp/document/9.6/html/runtime-config-logging.html#guc-log-min-duration-statement

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
What you can do with signing up
2