Re: logging to a file - Mailing list pgsql-general

From Arguile
Subject Re: logging to a file
Date
Msg-id LLENKEMIODLDJNHBEFBOOEOJENAA.arguile@lucentstudios.com
Whole thread Raw
In response to logging to a file  (Vincent Stoessel <vincent@xaymaca.com>)
List 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.



pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Help with data transfer please
Next
From: "Alan"
Date:
Subject: Re: Help with data transfer please