Re: Proposal: Adding json logging

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Proposal: Adding json logging
Дата
Msg-id 20180419002604.GB957@paquier.xyz
обсуждение исходный текст
Ответ на Re: Proposal: Adding json logging  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On Wed, Apr 18, 2018 at 02:59:26PM -0400, Robert Haas wrote:
> ====
> Note that logging_collector should be enabled in postgresql.conf to
> ensure consistent log outputs.  As JSON strings are longer than normal
> logs generated by PostgreSQL, this module increases the odds of malformed
> log entries.
> ====
>
> I'm not sure I understand the issue, but I don't like malformed log entries.

If logging_collector is disabled, then all the log entries would just go
to stderr (that's mentioned in the docs).  While that may be fine for
low volumes of logs, for many concurrent processes generating logs then
a process can overwrite another process log entry.  The logs generated by
the JSON format are longer in length, increased mainly by the repetitive
use of the key names in the blob, which increase in turn the volume
generated.

So in this case this can cause JSON blobs to look broken.  I had a
report on github not long ago about that:
https://github.com/michaelpq/pg_plugins/issues/17
--
Michael

Вложения

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Fix for documentation of Covering Indexes
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Proposal: Adding json logging