Re: Proposal: More structured logging

From: Ronan Dunklau <ronan(dot)dunklau(at)aiven(dot)io>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Proposal: More structured logging
Date: 2022-01-11 10:05:26
Message-ID: 10995044.nUPlyArG6x@aivenronan
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Le mercredi 29 décembre 2021, 14:59:16 CET Justin Pryzby a écrit :
> > Subject: [PATCH v3 2/3] Add test module for the new tag functionality.
>
> ...
>
> > +test_logging(PG_FUNCTION_ARGS)
> > +{
>
> ...
>
> > + (errmsg("%s", message),
> > + ({
> > + forboth(lk, keys, lv, values)
> > + {
> > + (errtag(lfirst(lk), "%s", (char *)
lfirst(lv)));
> > + }})
> > + ));
>
> The windows build fails with that syntax.
> http://cfbot.cputube.org/ronan-dunklau.html
> https://ci.appveyor.com/project/postgresql-cfbot/postgresql/build/1.0.157923

Thank you. I switched to an explicit sequence of errstart / errfinish to avoid
putting too much things in nested macro calls. As I don't have any Windows
knowledge, I am very grateful for the new cirrus-ci integration which allowed
me to build on Windows without hassle.

> > Subject: [PATCH v3 3/3] Output error tags in CSV logs
> > +++ b/doc/src/sgml/config.sgml
> > @@ -7370,6 +7371,7 @@ CREATE TABLE postgres_log
> >
> > backend_type text,
> > leader_pid integer,
> > query_id bigint,
> >
> > + tags jsonb
> >
> > PRIMARY KEY (session_id, session_line_num)
> >
> > );
> > </programlisting>
>
> That's invalid sql due to missing a trailing ",".

Thanks, fixed.

>
> You should also update file-fdw.sgml - which I only think of since we forgot
> in to update it before e568ed0eb and 0830d21f5. config.sgml should have a
> comment as a reminder to do that.

Done, and I added anoher commit per your suggestion to add this comment.

Thank you for this review.

Regards,

--
Ronan Dunklau

Attachment Content-Type Size
v4-0004-Add-comment-in-config.sgml-as-a-reminder-to-also-.patch text/x-patch 863 bytes
v4-0003-Output-error-tags-in-CSV-logs.patch text/x-patch 2.9 KB
v4-0002-Add-test-module-for-the-new-tag-functionality.patch text/x-patch 6.6 KB
v4-0001-Add-ErrorTag-support.patch text/x-patch 4.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2022-01-11 10:08:04 Re: Skipping logical replication transactions on subscriber side
Previous Message Thomas Munro 2022-01-11 09:59:13 Re: Add client connection check during the execution of the query