Re: log_statement at postgres.conf - Mailing list pgsql-performance

From Claus Guttesen
Subject Re: log_statement at postgres.conf
Date
Msg-id b41c75520807170229x7768f6d3u68fb6369bafea270@mail.gmail.com
Whole thread Raw
In response to log_statement at postgres.conf  ("System/IJS - Joko" <system@ijs.co.id>)
Responses Re: log_statement at postgres.conf  (Pomarede Nicolas <npomarede@corp.free.fr>)
List pgsql-performance
> After setting log_statement='all' at postgres.conf,
> then i'm rebooting OS [freeBSD or CentOS],
> i can't find where log file created from log_statement='all' located...
> FYI, location of postgres.conf at /var/lib/pgsql/data/postgres.conf
>
> many thanks..

I added the following to FreeBSD:

/etc/newsyslog.conf:
/var/log/postgresql                     600  7     *    @T00  JC

/etc/syslog.conf:
local0.*                                        /var/log/postgresql

/usr/local/pgsql/data/postgresql.conf:
log_destination = 'syslog'
syslog_facility = 'LOCAL0'
syslog_ident = 'postgres'
log_min_duration_statement = 100        # -1 is disabled, 0 logs all
statements, in ms.

Remember to touch /var/log/postgresql before restarting syslogd (kill
-HUP syslog-pid). Chmod 0700 so only root can read the log-file.
Adjust log_min_duration_statement to your needs.

I found this recipe somewhere, but don't remember where so I can't
give credit to the that person.

--
regards
Claus

When lenity and cruelty play for a kingdom,
the gentlest gamester is the soonest winner.

Shakespeare

pgsql-performance by date:

Previous
From: "System/IJS - Joko"
Date:
Subject: log_statement at postgres.conf
Next
From: Pomarede Nicolas
Date:
Subject: Re: log_statement at postgres.conf