Re: Proposal: Adding json logging

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Proposal: Adding json logging
Дата
Msg-id 20180419003327.GC957@paquier.xyz
обсуждение исходный текст
Ответ на Re: Proposal: Adding json logging  (Christophe Pettus <xof@thebuild.com>)
Список pgsql-hackers
On Wed, Apr 18, 2018 at 12:10:47PM -0700, Christophe Pettus wrote:
> On Apr 18, 2018, at 11:59, Robert Haas <robertmhaas@gmail.com> wrote:
>> For the record, I'm tentatively in favor of including something like
>> this in contrib.
>
> I'm much less fussed by this in contrib/ (with the same concern you
> noted), at minimum as an example of how to do logging in other
> formats.

Using a contrib module for logging format has also a side effect. When
the logging collector is disabled, all the log entries which are created
by the postmaster have junk data as it is sort of impossible to make the
loaded module know that the logging collector is enabled in
configuration but that the log entries cannot use the pipe protocol
yet.  In short, you finish with a couple of entries which are formatted
for the pipe protocol used by the syslogger but are redirected to
stderr.  There are only a couple of entries which enter in this
category, like a misconfiguration of the server, or the ports the server
is listening to (look for redirection_done in elog.c).  One simple fix
would be to pass down the value of redirection_done to emit_log_hook,
and this requires patching the server.
--
Michael

Вложения

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Proposal: Adding json logging
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: PostgreSQL's handling of fsync() errors is unsafe and risks data loss at least on XFS