Logging Postgres queries

Here’s how to configure Postgres to write all queries to log file that you can follow.

Edit postgresql.conf (usually in /etc/postgresql/8.4/main/) to contain these lines:

log_statement=‘all’
log_destination=‘csvlog’
logging_collector=on

Now, the log should appear at /etc/postgresql/8.4/main/pg_log/*.csv


postgres

35 Words

2010-12-20 11:56 +0000