Re: Add jsonlog log_destination for JSON server logs
Nathan Bossart <bossartn@amazon.com>
From: "Bossart, Nathan" <bossartn@amazon.com>
To: Michael Paquier <michael@paquier.xyz>, Andrew Dunstan <andrew@dunslane.net>
Cc: 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-11T20:34:26Z
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 1/10/22, 4:51 AM, "Michael Paquier" <michael@paquier.xyz> wrote: > The issue comes from an incorrect change in syslogger_parseArgs() > where I missed that the incrementation of argv by 3 has no need to be > changed. A build with -DEXEC_BACKEND is enough to show the failure, > which caused a crash when starting up the syslogger because of a NULL > pointer dereference. The attached v9 should be enough to switch the > CF bot to green. I've been looking at the latest patch set intermittently and playing around with jsonlog a little. It seems to work well, and I don't have any significant comments about the code. 0001 and 0002 seem straightforward and uncontroversial. IIUC 0003 simply introduces jsonlog using the existing framework. I wonder if we should consider tracking each log destination as a set of function pointers. The main logging code would just loop through the enabled log destinations and use these functions, and it otherwise would be completely detached (i.e., no "if jsonlog" blocks). This might open up the ability to define custom log destinations via modules, too. However, I don't know if there's any real demand for something like this, and it should probably be done separately from introducing jsonlog, anyway. Nathan