Lists: | pgsql-hackers |
---|
From: | Jeff Davis <pgsql(at)j-davis(dot)com> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Export log_line_prefix(); useful for emit_log_hook. |
Date: | 2022-06-28 18:52:56 |
Message-ID: | [email protected] |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Lists: | pgsql-hackers |
Patch attached. Some kinds of emit log hooks might find it useful to
also compute the log_line_prefix.
Regards,
Jeff Davis
Attachment | Content-Type | Size |
---|---|---|
0001-Export-log_line_prefix-useful-for-emit_log_hook.patch | text/x-patch | 2.0 KB |
From: | Michael Paquier <michael(at)paquier(dot)xyz> |
---|---|
To: | Jeff Davis <pgsql(at)j-davis(dot)com> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Export log_line_prefix(); useful for emit_log_hook. |
Date: | 2022-06-29 01:17:15 |
Message-ID: | YruoG3wYsI0Jq/[email protected] |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Lists: | pgsql-hackers |
On Tue, Jun 28, 2022 at 11:52:56AM -0700, Jeff Davis wrote:
> Patch attached. Some kinds of emit log hooks might find it useful to
> also compute the log_line_prefix.
Have you played with anything specific that would require that? I
am fine to expose this routine, being mostly curious about what kind
of recent format implemented with the elog hook would use it.
--
Michael
From: | Jeff Davis <pgsql(at)j-davis(dot)com> |
---|---|
To: | Michael Paquier <michael(at)paquier(dot)xyz> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Export log_line_prefix(); useful for emit_log_hook. |
Date: | 2022-06-29 05:32:31 |
Message-ID: | [email protected] |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Lists: | pgsql-hackers |
On Wed, 2022-06-29 at 10:17 +0900, Michael Paquier wrote:
> On Tue, Jun 28, 2022 at 11:52:56AM -0700, Jeff Davis wrote:
> > Patch attached. Some kinds of emit log hooks might find it useful
> > to
> > also compute the log_line_prefix.
>
> Have you played with anything specific that would require that? I
> am fine to expose this routine, being mostly curious about what kind
> of recent format implemented with the elog hook would use it.
Just a slightly different format that is directly digestible by another
system, while still preserving what the original messages in the file
would look like.
There are other ways to do it, but it's convenient. If we use, e.g.,
csv or json format, we lose the log_line_prefix and would need to
regenerate it from the individual fields.
Regards,
Jeff Davis
From: | Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> |
---|---|
To: | Jeff Davis <pgsql(at)j-davis(dot)com> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Export log_line_prefix(); useful for emit_log_hook. |
Date: | 2022-06-29 13:09:42 |
Message-ID: | [email protected] |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Lists: | pgsql-hackers |
On 2022-Jun-28, Jeff Davis wrote:
> Patch attached. Some kinds of emit log hooks might find it useful to
> also compute the log_line_prefix.
Hmm, maybe your hypothetical book would prefer to use a different
setting for log line prefix than Log_line_prefix, so it would make sense
to pass the format string as a parameter to the function instead of
relying on the GUC global.
--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
"Java is clearly an example of money oriented programming" (A. Stepanov)
From: | Michael Paquier <michael(at)paquier(dot)xyz> |
---|---|
To: | Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> |
Cc: | Jeff Davis <pgsql(at)j-davis(dot)com>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Export log_line_prefix(); useful for emit_log_hook. |
Date: | 2022-07-04 06:54:44 |
Message-ID: | YsKOtLNJy/[email protected] |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Lists: | pgsql-hackers |
On Wed, Jun 29, 2022 at 03:09:42PM +0200, Alvaro Herrera wrote:
> Hmm, maybe your hypothetical book would prefer to use a different
> setting for log line prefix than Log_line_prefix, so it would make sense
> to pass the format string as a parameter to the function instead of
> relying on the GUC global.
+1.
--
Michael
From: | Jeff Davis <pgsql(at)j-davis(dot)com> |
---|---|
To: | Michael Paquier <michael(at)paquier(dot)xyz>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Export log_line_prefix(); useful for emit_log_hook. |
Date: | 2022-07-04 20:24:36 |
Message-ID: | [email protected] |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Lists: | pgsql-hackers |
On Mon, 2022-07-04 at 15:54 +0900, Michael Paquier wrote:
> On Wed, Jun 29, 2022 at 03:09:42PM +0200, Alvaro Herrera wrote:
> > Hmm, maybe your hypothetical book would prefer to use a different
> > setting for log line prefix than Log_line_prefix, so it would make
> > sense
> > to pass the format string as a parameter to the function instead of
> > relying on the GUC global.
That is nicer, attached.
I also renamed the function log_status_format(), and made
log_line_prefix() a thin wrapper over that. I think that's less
confusing.
Regards,
Jeff Davis
Attachment | Content-Type | Size |
---|---|---|
v2-0001-Provide-log_status_format-useful-for-an-emit_log_hoo.patch | text/x-patch | 2.3 KB |