Re: Add jsonlog log_destination for JSON server logs
Sehrope Sarkuni <sehrope@jackdb.com>
From: Sehrope Sarkuni <sehrope@jackdb.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>, david@fetter.org
Date: 2021-09-01T20:39:43Z
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
- v2-0001-Adds-separate-dest-field-to-log-protocol-PipeProtoHe.patch (text/x-patch) patch v2-0001
- v2-0002-Add-TAP-test-for-csvlog.patch (text/x-patch) patch v2-0002
- v2-0003-Split-csv-handling-in-elog-c-into-separate-csvlog-c.patch (text/x-patch) patch v2-0003
- v2-0004-Add-jsonlog-log_destination-for-JSON-server-logs.patch (text/x-patch) patch v2-0004
Updated patch set is attached. This version splits out the existing csvlog code into its own file and centralizes the common helpers into a new elog-internal.h so that they're only included by the actual write_xyz sources. That makes the elog.c changes in the JSON logging patch minimal as all it's really doing is invoking the new write_jsonlog(...) function. It also adds those missing fields to the JSON logger output. Regards, -- Sehrope Sarkuni Founder & CEO | JackDB, Inc. | https://www.jackdb.com/