The PostgreSQL instance on dbreplica0.euwest.azure.internal.softwareheritage.org writes logs of all SQL queries to the /var/log/postgresql directory.
These logs have been accumulating for months, causing the root filesystem to become full.
Description
Description
Event Timeline
Comment Actions
There is no need to log all production queries on this server.
Reducing logged contents to queries taking more than one millisecond to execute:
[/etc/postgresql/10/replica/postgresql.conf]
-log_min_duration_statement = 0 # -1 is disabled, 0 logs all statements +log_min_duration_statement = 1 # -1 is disabled, 0 logs all statements
Comment Actions
Only keep 24 hours of log, and keep rotating on the same file names:
[/etc/postgresql/10/replica/postgresql.conf]
-log_filename = 'postgresql-10-replica-%Y-%m-%d_%H%M%S.log' +log_filename = 'postgresql-10-replica-%H%.log' -#log_truncate_on_rotation = off +log_truncate_on_rotation = on