Re: Add jsonlog log_destination for JSON server logs

From: "Bossart, Nathan" <bossartn(at)amazon(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>, Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Sehrope Sarkuni <sehrope(at)jackdb(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, "david(at)fetter(dot)org" <david(at)fetter(dot)org>
Subject: Re: Add jsonlog log_destination for JSON server logs
Date: 2022-01-11 20:34:26
Message-ID: 2674A01D-CC61-42DA-9923-DEF943D08FF1@amazon.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 1/10/22, 4:51 AM, "Michael Paquier" <michael(at)paquier(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2022-01-11 20:54:19 Re: Use -fvisibility=hidden for shared libraries
Previous Message Imseih (AWS), Sami 2022-01-11 20:33:16 Re: Add index scan progress to pg_stat_progress_vacuum