postgreで SQL 実行の詳細なログをとる

log_duration = on (SQLの実行時間をログ)
log_statement = 'all' (全てのSQLをログ)
で詳細なログ出力をするように設定。

あとは、ログ出力の設定。
redirect_stderr = on
log_destination = 'stderr'
logging_collector = off
log_directory = 'pg_log'
log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'

log_line_prefix = '%t myhost postgres[%p]: [%l-1] '
見やすいように。