I want to monitor all queries to my postgresql instance. Following these steps, I created a custom db parameter group, set log_statement
to all
and log_min_duration_statement
to 1
, applied the parameter group to my instance, and rebooted it. Then I fired a POST
request to the instance but a record of query wasn't to be found in the Recent Events & Logs
tab of my instance. Doing a SELECT * FROM table
query in psql
however shows that the resource was created and the post request worked. What am I missing in order to see the logs?
Setting log_min_duration_statement
to 1
tells Postgres to only log queries that take longer than 1 ms. If you set it to 0
instead, all queries will be logged (the default, no logging, is -1
).
You followed the right steps, all that is left is to make sure the parameter group is properly applied to your Postgres instance. Look at the Parameter Group in the Configuration Details tab of your instance, and make sure they have the right group name followed by "in-sync". A reboot is usually required when changing parameter groups on an instance, this may be what is (was?) missing in your case.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With