Re: backend type in log_line_prefix?

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: backend type in log_line_prefix?
Date: 2020-03-14 15:49:49
Message-ID: 20200314154948.GU29065@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Feb 21, 2020 at 10:09:38AM +0100, Peter Eisentraut wrote:
> From 75ac8ed0c47801712eb2aa300d9cb29767d2e121 Mon Sep 17 00:00:00 2001
> From: Peter Eisentraut <peter(at)eisentraut(dot)org>
> Date: Thu, 20 Feb 2020 18:16:39 +0100
> Subject: [PATCH v2 3/4] Add backend type to csvlog and optionally log_line_prefix

> diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
> index c1128f89ec..206778b1c3 100644
> --- a/doc/src/sgml/config.sgml
> +++ b/doc/src/sgml/config.sgml
> @@ -6470,6 +6470,11 @@ <title>What to Log</title>

characters are copied straight to the log line. Some escapes are
only recognized by session processes, and will be treated as empty by
background processes such as the main server process. Status
...
<entry>Escape</entry>
<entry>Effect</entry>
<entry>Session only</entry>

> <entry>Application name</entry>
> <entry>yes</entry>
> </row>
> + <row>
> + <entry><literal>%b</literal></entry>
> + <entry>Backend process type</entry>
> + <entry>yes</entry>

=> should say "no", it's not blank for background processes:

> +
> + if (MyProcPid == PostmasterPid)
> + backend_type_str = "postmaster";
> + else if (MyBackendType == B_BG_WORKER)
> + backend_type_str = MyBgworkerEntry->bgw_type;
> + else
> + backend_type_str = pgstat_get_backend_desc(MyBackendType);

--
Justin

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message James Coleman 2020-03-14 16:07:51 Re: [PATCH] Incremental sort (was: PoC: Partial sort)
Previous Message Tomas Vondra 2020-03-14 15:21:59 Re: PATCH: add support for IN and @> in functional-dependency statistics use