Re: Fix for timestamp lag issue from emit_log_hook when GUC log_line_prefix has '%m' - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Fix for timestamp lag issue from emit_log_hook when GUC log_line_prefix has '%m'
Date
Msg-id ZffNWb5Zm8WZwMLY@paquier.xyz
Whole thread Raw
In response to Re: Fix for timestamp lag issue from emit_log_hook when GUC log_line_prefix has '%m'  (Kambam Vinay <vinaykambam@gmail.com>)
Responses Re: Fix for timestamp lag issue from emit_log_hook when GUC log_line_prefix has '%m'
List pgsql-hackers
On Sun, Mar 17, 2024 at 07:35:57PM +0530, Kambam Vinay wrote:
> Thanks Michael for the review. Agree with your comment on the patch.
> updated the patch with recommended change.

That should be fine.  I would suggest to document why the reset is
done at this location, aka this is to ensure that the same formatted
timestamp is used across the board, for all log destinations as well
as hook callers that rely on log_line_prefix.

While reviewing, I have noticed that a comment was not correct: JSON
logs also use the formatted timestamp via get_formatted_log_time().

I may be able to get this one committed just before the feature freeze
of v17, as timestamp consistency for hooks that call
log_status_format() is narrow.  For now, I have added an entry in the
CF app to keep track of it:
https://commitfest.postgresql.org/48/4901/
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: speed up a logical replica setup
Next
From: Michael Paquier
Date:
Subject: Re: Add new error_action COPY ON_ERROR "log"