Re: Add jsonlog log_destination for JSON server logs
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Sehrope Sarkuni <sehrope@jackdb.com>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>, david@fetter.org
Date: 2021-09-10T06:56:18Z
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
- tap-csvlog.patch (text/plain) patch
On Fri, Sep 10, 2021 at 01:07:00PM +0900, Michael Paquier wrote: > Forking a bit this thread while looking at 0002 that adds new tests > for csvlog. While I agree that it would be useful to have more > coverage with the syslogger message chunk protocol in this area, I > think that having a separate test is a waste of resources. Creating a > new node is not cheap either, and this adds more wait phases, making > the tests take longer. It would be much better to extend > 004_logrotate.pl and update it to use log_destination = 'stderr, > csvlog', to minimize the number of nodes we create as well as the > additional amount of time we'd spend for those tests. Plugging in > JSON into that would not be complicated either once we have in place a > set of small routines that limit the code duplication between the > checks for each log destination type. And this part leads me to the attached, where the addition of the JSON format would result in the addition of a couple of lines. -- Michael