Re: Add jsonlog log_destination for JSON server logs
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: "Bossart, Nathan" <bossartn@amazon.com>
Cc: Andrew Dunstan <andrew@dunslane.net>, Andres Freund <andres@anarazel.de>, Sehrope Sarkuni <sehrope@jackdb.com>, Pg Hackers <pgsql-hackers@postgresql.org>, "david@fetter.org" <david@fetter.org>
Date: 2022-01-17T02:12:36Z
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
On Mon, Jan 17, 2022 at 10:48:06AM +0900, Michael Paquier wrote: > Okay, this last piece has been applied this morning, after more review > and a couple of adjustments, mainly cosmetic (pg_current_logfile > missed a refresh, incorrect copyright in jsonlog.c, etc.). Let's see > what the buildfarm thinks. By the way, while on it, using directly COPY to load the logs from a generated .json file can be trickier than it looks, as backslashes require an extra escap when loading the data. One idea, while not the best performance-wise, is to rely on COPY FROM PROGRAM with commands like that: CREATE TABLE logs (data jsonb); COPY logs FROM PROGRAM 'cat logs.json | sed ''s/\\/\\\\/g'''; -- Michael