Re: Logging question - Mailing list pgsql-general

From Madison Kelly
Subject Re: Logging question
Date
Msg-id 41EC9F5D.1030007@alteeve.com
Whole thread Raw
In response to Re: Logging question  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Tom Lane wrote:
> Madison Kelly <linux@alteeve.com> writes:
>
>>Where /is/ the log file?
>
>
> It depends.  If you selected syslog logging then it's wherever syslog is
> configured to put the messages.  Otherwise, it's wherever the
> postmaster's stderr output is being sent.
>
> A fairly annoying property of the current RPM packagings is that their
> startup script sends postmaster stderr to /dev/null.  We have (finally)
> fixed that for 8.0, but in current releases you need to alter the
> startup script in order to get useful log output.
>
>             regards, tom lane

woohoo!!

Thank you, I would have taken forever to figure that out on my own...
For the record on Fedora Core 1 the line to change is:

'/etc/rc.d/rc3.d/s85postgresql' line 171

Which I changed from:

su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl  -D $PGDATA -p
/usr/bin/postmaster -o '-p ${PGPORT}' start  > /dev/null 2>&1" < $

to...

su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl  -D $PGDATA -p
/usr/bin/postmaster -o '-p ${PGPORT}' start  > /var/log/psql.log $#


I had to touch the 'psql.log' file and then 'chown' it to
'postgres:postgres' but now my queries are being logged. Adding the earlier:

ALTER USER johndoe SET log_statement TO TRUE;

that Michael Fuhr mentioned and I have exactly what I wanted happening.
Thank you all -very- much!

Madison

pgsql-general by date:

Previous
From: Michael Glaesemann
Date:
Subject: Re: Logging question
Next
From: Hong Yuan
Date:
Subject: Re: Multiline plpython procedure