Re: Proposal: More structured logging

Поиск
Список
Период
Сортировка
От Ronan Dunklau
Тема Re: Proposal: More structured logging
Дата
Msg-id 1745789.A5U81WbCk6@aivenronan
обсуждение исходный текст
Ответ на Re: Proposal: More structured logging  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Ответы Re: Proposal: More structured logging  (Ronan Dunklau <ronan.dunklau@aiven.io>)
Список pgsql-hackers
Le jeudi 19 août 2021, 15:04:30 CEST Alvaro Herrera a écrit :
> On 2021-Aug-13, Ronan Dunklau wrote:
> > ereport(NOTICE,
> >
> >  (errmsg("My log message")),
> >  (errtag("EMITTER", "MYEXTENSION")),
> >  (errtag("MSG-ID", "%d", error_message_id))
> >
> > );
>
> Interesting idea.   I agree this would be useful.
>
> > Please find attached a very small POC patch to better demonstrate what I
> > propose.
>
> Seems like a good start.  I think a further step towards a committable
> patch would include a test module that uses the new tagging
> functionality.

Please find attached the original patch + a new one adding a test module.
The test module exposes a function for generating logs with tags, and a log
hook which format the tags in the DETAIL field for easy regression testing.

Next step would be to emit those tags in the CSV logs. I'm not sure what
representation they should have though: a nested csv in it's own column ? A
key => value pairs list similar to hstore ? A json object ?

Also we should probably make this available to the client too, but once again
the format of the tag field needs to be defined. Any opinion ?



--
Ronan Dunklau
Вложения

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

Предыдущее
От: "tanghy.fnst@fujitsu.com"
Дата:
Сообщение: RE: Skipping logical replication transactions on subscriber side
Следующее
От: Ronan Dunklau
Дата:
Сообщение: Re: Proposal: More structured logging