Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1jD931-000497-Bs for pgsql-hackers@arkaria.postgresql.org; Sat, 14 Mar 2020 15:49:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jD930-0003rr-2r for pgsql-hackers@arkaria.postgresql.org; Sat, 14 Mar 2020 15:49:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jD92z-0003rk-M6 for pgsql-hackers@lists.postgresql.org; Sat, 14 Mar 2020 15:49:57 +0000 Received: from mail-qv1-xf33.google.com ([2607:f8b0:4864:20::f33]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jD92x-0006nQ-09 for pgsql-hackers@postgresql.org; Sat, 14 Mar 2020 15:49:57 +0000 Received: by mail-qv1-xf33.google.com with SMTP id w5so6391870qvp.11 for ; Sat, 14 Mar 2020 08:49:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=H0GYGkQE1hHZcEel2rYqW1wJPo34Y06UVuxYALQRXhk=; b=CFXtJ2m3skglBHs89S87lBUUuzEuPTjfeod5cGN3hASNcNxeMKSRSnuf3OsIyz5qHt bO5jpJ6xqfIYVEyRqjUoBT4jWZNWuJAFS/cKB9S4XbCVwyYQgaYM5XYyNbQqScZtg3z4 L1nWpSoZXE6onas8p1TVFHlW1YhcMKGThh20WuwelBVZR7yvgG7l0z/fQOC4xqMcP1Fd KytVaqiXKWNqntpF4G/QEwjkTIMP71ZNJ0Dt7Q1ufdmlB4sIdFniaY+jbasywqZ7CSvP KHB3J4iEgfzirPq1TN6ZD/h82Y7eWDM6Nl9bY8Zz6lirw8OlsClVs5xW36t5mY9rtWHq pdlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=H0GYGkQE1hHZcEel2rYqW1wJPo34Y06UVuxYALQRXhk=; b=L+rJLrtT/iYT6Mg02jwXEGpro4bmscYTsXG7Qt6E5vqFd0vyTLvHUT1o3G2yyZzE9J /R//eMGu+S2hOB/nt65uMOtDnBYwWeYJHzLCP57WJRZkhLMTUArUgNjOXCBiTWTDdCzu XD80Tb/hnAG3ZFOIX+BCEf15GgZf/U1bowPc8z4UYYuR2ei3V13zuCwREugmOsap7ki2 TQZAI1XGpdlOYMDMmJ92uGdxQ1G+tPbNjijzYORD6m/cTpXfgXkZ5xcaBXPP7ZnJWXVh GK9CwkObOscKbuBuw4gbpt9Kew8faHE15jljCzSSsozv1HIt1ujOui7e5j2LtRBv1PZG C9Gw== X-Gm-Message-State: ANhLgQ2aHa+XMuLMNbEvOFQR6OQUKpZySPWJVhqu/cn5KtGASNisqzUo zylevUxa/PgX2b/MjadHBjO92Q== X-Google-Smtp-Source: ADFU+vv90+eYDY2xo7SFYTZUXzAAKdIEj5SYHKScmX2wGVNGwkOUcqeR78kuU0wbT1d5VIoK4Ij76g== X-Received: by 2002:ad4:46e6:: with SMTP id h6mr11339862qvw.208.1584200991856; Sat, 14 Mar 2020 08:49:51 -0700 (PDT) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id u51sm7635576qth.46.2020.03.14.08.49.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 14 Mar 2020 08:49:50 -0700 (PDT) Received: by pryzbyj (Postfix, from userid 1000) id 2AD73800827; Sat, 14 Mar 2020 10:49:49 -0500 (CDT) Date: Sat, 14 Mar 2020 10:49:49 -0500 From: Justin Pryzby To: Peter Eisentraut Cc: pgsql-hackers@postgresql.org Subject: Re: backend type in log_line_prefix? Message-ID: <20200314154948.GU29065@telsasoft.com> References: <6453e044-041a-bf64-c76a-e1b7e3d5b0e7@2ndquadrant.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6453e044-041a-bf64-c76a-e1b7e3d5b0e7@2ndquadrant.com> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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 > 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 @@ What to Log 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 ... Escape Effect Session only > Application name > yes > > + > + %b > + Backend process type > + yes => 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