Re: Proposal: More structured logging

Peter Eisentraut <peter.eisentraut@enterprisedb.com>

From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: Ronan Dunklau <ronan.dunklau@aiven.io>, pgsql-hackers@lists.postgresql.org
Date: 2021-09-08T09:51:31Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix ruleutils.c's dumping of whole-row Vars in more contexts.

On 01.09.21 10:00, Ronan Dunklau wrote:
> In-core it would open up the possibility to split log messages into different
> fields, for example the different statistics reported in the logs by VACUUM /
> ANALYZE VERBOSE and make it easier to consume the output without having to
> parse the message. Parsing the message also means that any tool parsing it
> needs to either be aware of the locale, or to force the user to use a specific
> one.

I think those messages would themselves have substructure.  For example, 
the current message

     "I/O timings: read: %.3f ms, write: %.3f ms\n"

might be

     {"I/O timings": {"read": ..., "write": ...}}

and that in turn is already part of a larger message.

So just having a single level of tags wouldn't really work for this.