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-29T02:02:10Z
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 Tue, Sep 28, 2021 at 12:30:10PM +0900, Michael Paquier wrote: > 0001 is in a rather commitable shape, and I have made the code > consistent with HEAD. However, I think that its handling of > _get_osfhandle() is clunky for 64-bit compilations as long is 32b in > WIN32 but intptr_t is platform-dependent as it could be 32b or 64b, so > atoi() would overflow if the handle is larger than INT_MAX for 64b > builds: > https://docs.microsoft.com/en-us/cpp/c-runtime-library/standard-types > This problem deserves a different thread. This happens to not be a problem as only 32 bits are significant for handles for both Win32 and Win64. This also means that we should be able to remove the use for "long" in this code, making the routines more symmetric. I have done more tests with Win32 and Win64, and applied it. I don't have MinGW environments at hand, but looking at the upstream code that should not matter. The buildfarm will let us know soon enough if there is a problem thanks to the TAP tests of pg_ctl. -- Michael