pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Coordinate emit_log_hook and all log destinations to share the s
Date: Thu, 04 Apr 2024 05:18:19 +0000
Message-ID: <E1rsFUQ-000P2m-R1@gemulon.postgresql.org> (raw)

Coordinate emit_log_hook and all log destinations to share the same timeval

This would cause the timestamp values used by emit_log_hook and all the
other log destinations to differ, because the timestamps are reset
before sending the logs to the server and after calling the hook.

This change matters for emit_log_hook when generating log information
with 'n' or 'm' in log_line_prefix through log_status_format(), or when
doing direct calls to get_formatted_log_time() like in the JSON or CSV
log formats.

While on it, this commit fixes a couple of comments related to the
formatted timestamps where the JSON was not mentioned.  Oversight in
dc686681e079, that I have noticed while reviewing this patch.

Author: Kambam Vinay, Michael Paquier
Discussion: https://postgr.es/m/CANiRfmsK36A0i8mnQtzaxhSm3CUCimPwJPp4WQNq53OdSNkgWg@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/2a217c371799ae3ecd8d32a137cea874fad7f5dc

Modified Files
--------------
src/backend/utils/error/elog.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)



Message-ID: <E1rsFUQ-000P2m-R1@gemulon.postgresql.org>
Permalink:  ../E1rsFUQ-000P2m-R1@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1rsFUQ-000P2m-R1@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Coordinate emit_log_hook and all log destinations to share the s
  In-Reply-To: <E1rsFUQ-000P2m-R1@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox