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 1mGhir-0001e3-LZ for pgsql-hackers@arkaria.postgresql.org; Thu, 19 Aug 2021 13:04:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mGhiq-0007TG-Gy for pgsql-hackers@arkaria.postgresql.org; Thu, 19 Aug 2021 13:04:40 +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 1mGhiq-0007T8-9L for pgsql-hackers@lists.postgresql.org; Thu, 19 Aug 2021 13:04:40 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mGhin-0001S0-HY for pgsql-hackers@lists.postgresql.org; Thu, 19 Aug 2021 13:04:39 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 9138D3200A6E; Thu, 19 Aug 2021 09:04:34 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 19 Aug 2021 09:04:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=l1perP8h+li4xY2S3svW7H+zpegwnlUxMXpH0NzM3GY=; b=vyG4b4M5 66agdWA4Vek5lDL55W5M3+d8Cy5OMdYdWa5McJxwpSDMdWNX2lduhqkrXwMr1rjh AUX37LD4/6cLEalqzDZjV3FmOFHWrs0m3sC9r69GmnX7KC4lXDMpkNZAuZzwbf4g nNuJQ2JDkoEZj2ox6s01yeZHYAjTMA2O6gqttzm/vvDE6KGyHzGnSegdfXnCwBGW P0GW37R/Py4TzF9ZJKBgIhp5cRXo9xlFahyCshZU3pdvQDxpMQWXTWM588mT1FjK C/oH6do+Dbv98bjOEkfrEA0zAqwM9n93Vfc8Zv7304ZBCDew0Waxzaz7ff+snChx FINSus7BTn8qDA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrleejgdehlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgrrhho ucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgheqne cuggftrfgrthhtvghrnhepudejveejffejveduudetvdekieeuiedtvdeileefkeevjedu feeguedvjefhueelnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomhenuc evlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgv rhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Aug 2021 09:04:33 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 18BE72A08A7; Thu, 19 Aug 2021 09:04:30 -0400 (-04) Date: Thu, 19 Aug 2021 09:04:30 -0400 From: Alvaro Herrera To: Ronan Dunklau Cc: pgsql-hackers@lists.postgresql.org Subject: Re: Proposal: More structured logging Message-ID: <202108191304.u7g5wwuepwpe@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3207907.AWbSqkKDnR@aivenronan> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021-Aug-13, Ronan Dunklau wrote: > ereport(NOTICE, > (errmsg("My log message")), > (errtag("EMITTER", "MYEXTENSION")), > (errtag("MSG-ID", "%d", error_message_id)) > ); Interesting idea. I agree this would be useful. > Please find attached a very small POC patch to better demonstrate what I > propose. Seems like a good start. I think a further step towards a committable patch would include a test module that uses the new tagging functionality. > On a related note, the only structured logger we have in-core is the CSV > logger. Many users nowadays end up feeding the logs to journald either by > capturing the stderr output with systemd, or by having syslog implemented by > journald itself. Would there be any interest in having native journald support > as a logging_destination ? I don't know anything about journald, but I agree that we sorely need some better way to emit structured log entries. -- Álvaro Herrera Valdivia, Chile — https://www.EnterpriseDB.com/ "The problem with the facetime model is not just that it's demoralizing, but that the people pretending to work interrupt the ones actually working." (Paul Graham)