Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o6QKe-0004Ij-Gq for pgsql-hackers@arkaria.postgresql.org; Wed, 29 Jun 2022 05:33:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o6QJe-0002TO-UC for pgsql-hackers@arkaria.postgresql.org; Wed, 29 Jun 2022 05:32:42 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o6QJe-0002TF-LY for pgsql-hackers@lists.postgresql.org; Wed, 29 Jun 2022 05:32:42 +0000 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1o6QJY-0006ni-6b for pgsql-hackers@postgresql.org; Wed, 29 Jun 2022 05:32:42 +0000 Received: by mail-pg1-x52c.google.com with SMTP id 23so14264163pgc.8 for ; Tue, 28 Jun 2022 22:32:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20210112.gappssmtp.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=xsTbwJvFk0BtkCIVCMssE96maJfbfPt957yfSWC3Zm4=; b=nmqkWflhCYsiobofyRKoAu3EHAxSZ4kKHTkrtXpBfwlSe0E0F7yVl7Srish04zNs+M Lg9onQtz/5r4rv8Db9n/GiTOSdggxncDk1Q2Q9oK86fz8YZr7NQ1FDpiWgLlaRUT38VA otPtVzgMU452Mlau2g+hnqkZHlsRrbeJQ/aYYgHNjwh3vg6b0IAbaiDYtrQpa6Q23b0I 8wQDVpNSF50GE4YA8d8LUg6/sHsDaRiQyujuAbcRqRVDxKXwi68GAoPJTzQK/UarFuu5 u5I2EKqfkBDgPAPmvN1yA+cT9TkFVonu/t76t4MKHVX3aRyVUiHvTnC6HKO3k6L0PuFQ r68g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=xsTbwJvFk0BtkCIVCMssE96maJfbfPt957yfSWC3Zm4=; b=x7SILU+QqVnM64bfWjctfibwb3zKjZVEbCyGTjwJaRLetBYe8Gg3ow6PXu/5xm1mhi UQRp01bBx4m40dGNamlvxOQiY2aa6Q9+kDrZFhANK4t1dzYwTW7RuCpKwH7KblUMqQ05 KPlr0KryYcEQ4Bc2QRLVducG8/DEq/mC3aGhQZqi1cF1fDVqrzjmuTc1lebWxWlRNNZh zMzUX0YSaOYCvhIscJprZyo7rvOe67rVHZMcvCjtb0i680Z6ggIeuAS7/1qx/RE/Bsdb QQdGaHAGoZdo6GcKlb1zKKsEbENHbiBWqsyR/wd3vfj+fO3+P0WrIp3SCIPLS5/sWQt2 GkHQ== X-Gm-Message-State: AJIora+zq6dvA4IF8bFtU4MHCIHPZc5fZN4JMeergsiKIUEU8vvG9BRY /TQnF2EYqCfpQzua+4IFwBv61Kc5ra3Bzw== X-Google-Smtp-Source: AGRyM1tYrFBwwwqQqNQ2ZtLvc04UKNOkYa1xuBz5sDrQ3XbUuTk3HMxUvp8ym7W02edqY58nDeL4dg== X-Received: by 2002:a05:6a00:1687:b0:518:6c6b:6a9a with SMTP id k7-20020a056a00168700b005186c6b6a9amr7549137pfc.81.1656480753816; Tue, 28 Jun 2022 22:32:33 -0700 (PDT) Received: from jdavis.lan (c-73-231-146-4.hsd1.ca.comcast.net. [73.231.146.4]) by smtp.gmail.com with ESMTPSA id l127-20020a632585000000b0040c4f60f649sm10122127pgl.13.2022.06.28.22.32.32 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 Jun 2022 22:32:32 -0700 (PDT) Message-ID: <96bad2085dce2585fc747e20eba0aec4364cd371.camel@j-davis.com> Subject: Re: Export log_line_prefix(); useful for emit_log_hook. From: Jeff Davis To: Michael Paquier Cc: pgsql-hackers@postgresql.org Date: Tue, 28 Jun 2022 22:32:31 -0700 In-Reply-To: References: <39c8197652f4d3050aedafae79fa5af31096505f.camel@j-davis.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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