From: Justin Pryzby <pryzby@telsasoft.com>
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: backend type in log_line_prefix?
Date: Sat, 14 Mar 2020 10:49:49 -0500
Message-ID: <20200314154948.GU29065@telsasoft.com> (raw)
In-Reply-To: <6453e044-041a-bf64-c76a-e1b7e3d5b0e7@2ndquadrant.com>
References: <c65e5196-4f04-4ead-9353-6088c19615a3@2ndquadrant.com>
<6453e044-041a-bf64-c76a-e1b7e3d5b0e7@2ndquadrant.com>
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@eisentraut.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
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-hackers@postgresql.org
Cc: pryzby@telsasoft.com, peter.eisentraut@2ndquadrant.com
Subject: Re: backend type in log_line_prefix?
In-Reply-To: <20200314154948.GU29065@telsasoft.com>
* 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