I'm supporting a new system that's going live next month. I'm trying to have PostgreSQL log any long-running (over 1 second) queries to the error log. I've set the following parameters:
log_duration: 1
log_min_duration_statement: 1000
log_statement: all
However, the DB seems to be writing all queries to the log; e.g.:
2025-11-20 15:49:42 UTC:100.126.191.233(49316):foo@bar:[63907]:LOG: duration: 0.080 ms
2025-11-20 15:49:42 UTC:100.126.191.233(49316):foo@bar:[63907]:LOG: duration: 0.096 ms
2025-11-20 15:49:42 UTC:100.126.191.233(49316):foo@bar:[63907]:LOG: execute <unnamed>: UPDATE [...]
2025-11-20 15:49:42 UTC:100.126.191.233(49316):foo@bar:[63907]:DETAIL: Parameters: $1 = [...]
2025-11-20 15:49:42 UTC:100.126.191.233(49316):foo@bar:[63907]:LOG: duration: 0.467 ms
2025-11-20 15:49:42 UTC:100.126.169.109(36852):foo@bar:[63912]:LOG: duration: 0.125 ms
2025-11-20 15:49:42 UTC:100.126.169.109(36852):foo@bar:[63912]:LOG: execute S_112/C_144: SELECT [...]
2025-11-20 15:49:42 UTC:100.126.169.109(36852):foo@bar:[63912]:DETAIL: Parameters: $1 = [...]
2025-11-20 15:49:42 UTC:100.126.169.109(36852):foo@bar:[63912]:LOG: duration: 0.036 ms
2025-11-20 15:49:42 UTC:100.126.191.233(49316):foo@bar:[63907]:LOG: duration: 0.008 ms
2025-11-20 15:49:42 UTC:100.126.191.233(49316):foo@bar:[63907]:LOG: execute S_13: COMMIT
(all proprietary information has been redacted)
What am I doing wrong? This is Aurora PostgreSQL 17.5