Re: rotatelogs integration in pg_ctl

From: "Thomas Swan" <tswan(at)idigx(dot)com>
To: "Andrew Hammond" <ahammond(at)ca(dot)afilias(dot)info>
Cc: "PostgreSQL Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: rotatelogs integration in pg_ctl
Date: 2004-04-13 14:33:42
Message-ID: 51675.199.222.14.2.1081866822.squirrel@www.idigx.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

<quote who="Andrew Hammond">
> Tom Lane wrote:
>> Andrew Hammond <ahammond(at)ca(dot)afilias(dot)info> writes:
>>>I've attached a patch for pg_ctl which integrates the Apache project's
rotatelogs for logging.
>> Why bother? You just pipe pg_ctl's output to rotatelogs and you're done.
>
> It's not difficult to do, once you know how and once you know that there
aren't any gotchas. However, the question comes up often enough it's
clear that not everybody knows how. This provides a simple, clean,
standardized way of using rotatelog. The patch is simple, low risk, and
limited impact. So, why not?
>

Is there a reason the postmasters cannot just close/reopen-recreate the
log file when a SIGHUP or other signal is issued like apache? This would
allow for almost any scheme for log rotation to be handled by the system
or third party like logrotate and removes any duplicate effort between
projects.

I know on most distributions /var/log is not world writeable, so renaming
and and opening a file as postgres will not succeed. If the log files
are put in, for example, /var/log/pgsql with pgsql being rwx by postgres,
then it will work. The current packaging may need to be redone if you
want to enable loggin by default (if only startup and shutdown messages)

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephan Szabo 2004-04-13 14:47:09 Re: make == as = ?
Previous Message Fabien COELHO 2004-04-13 13:30:11 Re: user-defined default public acl