Re: more contrib: log rotator

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: more contrib: log rotator
Дата
Msg-id 10790.1049502178@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: more contrib: log rotator  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: more contrib: log rotator
Re: more contrib: log rotator
Re: more contrib: log rotator
Список pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> Tom Lane writes:
>> AFAICS, the only practical way to do this is to have a single process
>> collecting the stdout/stderr from the postmaster and all its children.

> I think not.  It's a little tricky handling it directly in the child
> processes, but it's been done before.

A "little" tricky?  Thanks, but no thanks ... for one thing, there'd be
no easy way to know when all the children had switched over to writing
the new file.  Also, at least for not-too-long messages, writing on a
single pipe gives atomicity guarantees that AFAIK do not exist when
writing a file through multiple independently opened descriptors.  In
the latter case I think we'd have lots of trouble with interleaving of
messages from different backends.

>> If someone can offer a better alternative than Andrew's, great, let's
>> see it.

> How about the attached one, which I floated a while ago but which didn't
> generate much interest.

Seems like a good bare-bones file writer; but how about all those
frammishes that people ask for like generating date-based filenames,
switching every so many bytes, etc?  Also, it'd be nice not to be
dependent on a cron job to tickle the switchover.

I do think there's an efficiency argument for having the log writer
coded in C, so starting with what you have here and building up might
be a better idea than starting with Andrew's perl script.  But the
important thing in my mind is to get something in there.

We should also take a look at Apache's rotator to see if there's any need
to reinvent the wheel at all.  I have not seen it, am not even sure what
it's written in...
        regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: more contrib: log rotator
Следующее
От: Kevin Brown
Дата:
Сообщение: Re: Detecting corrupted pages earlier