Re: Add jsonlog log_destination for JSON server logs - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Add jsonlog log_destination for JSON server logs
Date
Msg-id YTlunSciDRl1z7ik@paquier.xyz
Whole thread Raw
In response to Re: Add jsonlog log_destination for JSON server logs  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: Add jsonlog log_destination for JSON server logs  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
On Wed, Sep 08, 2021 at 08:46:44AM -0400, Andrew Dunstan wrote:
> Yeah. A very simple change would be to use two different values for json
> (say 'y' and 'n'). A slightly more principled scheme might use the top
> bit for the end marker and the bottom 3 bits for the dest type (so up to
> 8 types possible), with the rest available for future use.

I was thinking to track stderr as a case where no bits are set in the
flags for the area of the destinations, but that's a bit crazy if we
have a lot of margin in what can be stored.  I have looked at that and
finished with the attached which is an improvement IMO, especially
when it comes to the header validation.

FWIW, while looking at my own external module for the JSON logs, I
noticed that I used the chunk protocol when the log redirection is
enabled, but just enforced everything to be sent to stderr.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: "houzj.fnst@fujitsu.com"
Date:
Subject: RE: Parallel Inserts (WAS: [bug?] Missed parallel safety checks..)
Next
From: Michael Paquier
Date:
Subject: Re: drop tablespace failed when location contains .. on win32