Re: log_statement at postgres.conf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux