Vincent Stoessel writes:
>
> OK, I'm sorry but I have been looking through
> the docs and can some tell me how I can specify
> a log file to capture my postgres debug messages?
> Don't want to use syslog.
> Thanks in advance.
As far as I'm aware Pg currently doesn't support multiple named log files
based on message type. Using the standard *nix tools though you can easily
do it though.
First off postmaster -d x (and a postgresql.conf I can't remeber the name
of) controls the level of debugging output, where x is an int from 1 to 5.
To log all output either redirect manually "postmaster > logfile 2>&1 ..."
or use "pg_ctl -l logfile". To get all debugging output you can just "cat
logfile | grep ^DEBUG:" or "tail -f logfile | grep ^DEBUG" if you want a
running tally.
Alternately if you pipe to this first " perl -ne 'BEGIN{open DEBUG,
">>$ENV{PG_DATA}/debug_log"} print DEBUG if /^DEBUG/; print; END{close
DEBUG}' " you echo all the debugging returns into a seperate debug_log
before writing your combined log. You can play all sorts of variations along
the same theme or throw standard log rotators in there as well.