Re: Add jsonlog log_destination for JSON server logs
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Andrew Dunstan <andrew@dunslane.net>
Cc: Sehrope Sarkuni <sehrope@jackdb.com>, Pg Hackers <pgsql-hackers@postgresql.org>, david@fetter.org
Date: 2021-09-09T02:17:01Z
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 →
-
Introduce log_destination=jsonlog
- dc686681e079 15.0 landed
-
Refactor set of routines specific to elog.c
- ac7c80758a7a 15.0 landed
-
Fix compilation warning in syslogger.c
- 05c4248ad1bf 15.0 landed
-
Refactor per-destination file rotation in logging collector
- 5c6e33f07153 15.0 landed
-
Refactor output file handling when forking syslogger under EXEC_BACKEND
- 5b0b699f748e 15.0 landed
-
Add regression tests for csvlog with the logging collector
- 72b76f76161c 15.0 landed
-
Refactor the syslogger pipe protocol to use a bitmask for its options
- 2d77d835403a 15.0 landed
Attachments
- syslogger-flags.patch (text/plain) patch
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