Re: rotating log files

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Jelle Ouwerkerk <jelle(at)openface(dot)ca>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: rotating log files
Date: 2001-04-27 15:16:54
Message-ID: Pine.LNX.4.30.0104271713530.758-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jelle Ouwerkerk writes:

> I'm running 'Linux 2.2.16-22smp #1 SMP i686 unknown' and a solution that
> was proposed to me was to use cron and a program called logrotate:

> Unfortunately, after replacing/rotating/compressing the database log file,
> the new log file remains empty. I have a feeling that postgres has lost
> the reference to the original log file and that the new log data is lost
> into the void.

The logrotate program just moves the log file to a different name, but the
PostgreSQL server has the file open so it just keeps writing to the same
file no matter what name it has. What you need to do is pipe the log
output through a separate program that closes and reopens the file once in
a while. Apache has such a program, for example.

--
Peter Eisentraut peter_e(at)gmx(dot)net http://funkturm.homeip.net/~peter

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2001-04-27 15:19:37 Re: starting personal postmaster
Previous Message Joseph Koenig 2001-04-27 15:14:41 General usage for pg_dumpall