Re: serverlog rotation/functions

From: "Magnus Hagander" <mha(at)sollentuna(dot)net>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: "Andreas Pflug" <pgadmin(at)pse-consulting(dot)de>, "PostgreSQL Patches" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: serverlog rotation/functions
Date: 2004-07-14 08:17:44
Message-ID: 6BCB9D8A16AC4241919521715F4D8BCE34BE54@algol.sollentuna.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

> > Probably the big thing this program was trying to solve was for the
> > server to know the output file name, even with log file
> rotation, and
> > I don't see a pipe and 'rotatelogs' process really addressing this.
>
> It could be done. Given the infrastructure we have now, it's
> possible to imagine the log capture process being a child of
> the postmaster that can respond to GUC SIGHUPs (or forget
> that and just freeze the file name pattern at PGC_POSTMASTER
> time, which isn't really that big a drawback).
> You'd need the postmaster to create the pipe and then
> re-point its own stdout and stderr at it, but that's doable
> on Unixen at least (I'm less sure about Windows).

Given the issues we've had with stdout/stderr on mingw, I'm not
convinced it will work there. But I'm not convinced it won't work either
:-) What would be the portable way to do it on *nix - I could always run
some tests on w32. Just "stderr = mynewpipe;" is a bit too simplistic,
right?

The other option would be to go with a syslog-style implementation,
which you write explicitly to over a socket. But that won't address your
concern below (from other mail).

> The fundamentally unfixable problem with his method is that
> it can only capture elog output, not stderr output from
> libraries that we don't control (the dynamic linker being the
> biggest case, but there are others).

How common are these issues really? Just getting to the normal backend
output would probably be a big win in most sitations, wouldn't it? In
the case these libraries put out information, we get an elog() call *as
well*, don't we? Then you could easily redirect stderr somewhere on the
server, while still processing "ordinary elog output" through the log
manager.

//Magnus

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Oliver Elphick 2004-07-14 08:41:46 Re: [HACKERS] Is "trust" really a good default?
Previous Message Simon Riggs 2004-07-14 07:21:22 Re: [HACKERS] Point in Time Recovery