From: | "Arguile" <arguile(at)lucentstudios(dot)com> |
---|---|
To: | "Vincent Stoessel" <vincent(at)xaymaca(dot)com>, <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: logging to a file |
Date: | 2002-06-11 02:24:32 |
Message-ID: | LLENKEMIODLDJNHBEFBOOEOJENAA.arguile@lucentstudios.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
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.
From | Date | Subject | |
---|---|---|---|
Next Message | Alan | 2002-06-11 02:31:03 | Re: Help with data transfer please |
Previous Message | Tom Lane | 2002-06-11 02:00:27 | Re: Help with data transfer please |