I'm running PostgreSQL 8.4 on an Ubuntu server. I realized that my disk is out of space because the log file had became too large. Can I adjust what gets written to the log file?
PostgreSQL supports log rotation feature but doesn't support log removing feature. So user should remove logs manually or has to use logrotate utility to remove them.
The location of the log file will depend on the configuration. On Debian-based systems the default is /var/log/postgresql/postgresql-9.3-main. log (replace 9.3 with your version of PostgreSQL). On Red Hat-based systems it is located in /var/lib/pgsql/data/pg_log/ .
Edit /etc/postgresql/8.4/main/postgresql.conf
and change or disable the various log_*
parameters. Then reload postgresql.
You might also want to check what gets written to the logs. By default, there should not be that much logging. Possibly, your application is throwing lots of errors, which is what's filling up your hard disks.
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