Re: Log rotation

From: Fernando Nasser <fnasser(at)redhat(dot)com>
To: Lamar Owen <lowen(at)pari(dot)edu>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Log rotation
Date: 2004-03-13 15:36:23
Message-ID: 40532A77.7010808@redhat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Lamar Owen wrote:
>
>>Anyway, Syslog is not an option for us. We need flat files.
>
>
> Ok, riddle me this:
>
> If I have PostgreSQL set to log to syslog facility LOCAL0, and a local0.none
> on /var/log/messages and local0.* to /var/log/pgsql (assuming only one
> postmaster, unfortunately) then you get a flat file.
>

The problem is that sysloging has more overhead than a plain append to a
file. There are some very strict response time AppServer applications
where we want to keep this things out of the picture.

The other problem is that we have some nice graphical tools for
configuring logging but the /etc/syslog.conf is a very hard one to
automate dur to the pattern matching. We can add some lines there, like
one to get local0 to a specific file, but it will probably be guesswork
and require human inspection anyway.

> I can see that in a multipostmaster setting how you might want some
> differentiation between postmasters, but ISTM that the tool reading these
> logs should be trained in how to separate loglines out. I use a product
> called SmoothWall as a firewall/VPN solution, and its log reporting modules
> split out loglines in this way, so that I can have the ipsec logs in one
> browser page and the l2tp logs elsewhere, and the ppp logs elsewhere, and the
> kernel logs elsewhere....
>

It may be desirable to logrotate them at different times as well, so
they would have to be in different files.

> Or you'll have to include some other log rotator.
>

That is what Tom is proposing.

--
Fernando Nasser
Red Hat Canada Ltd. E-Mail: fnasser(at)redhat(dot)com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-03-13 15:39:39 Re: rapid degradation after postmaster restart
Previous Message Fernando Nasser 2004-03-13 15:25:12 Re: Log rotation