Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qqk3i-000owl-LP for pgsql-general@arkaria.postgresql.org; Thu, 12 Oct 2023 01:00:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qqk2h-002GPm-Ro for pgsql-general@arkaria.postgresql.org; Thu, 12 Oct 2023 00:59:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qqk2h-002GPe-Gx for pgsql-general@lists.postgresql.org; Thu, 12 Oct 2023 00:59:12 +0000 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qqk2e-00056t-5j for pgsql-general@postgresql.org; Thu, 12 Oct 2023 00:59:11 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 2BA1232009DB; Wed, 11 Oct 2023 20:59:06 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 11 Oct 2023 20:59:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1697072345; x=1697158745; bh=Pg wRdVog0mehWihFWXnJss+aanw2UkXBAenOfEMTLig=; b=Mg/tHvu4Z0NAULGJIo Vn3q6kubZeGQEBgpu/sy/RkKbTcteB0t49rGcYwUNL2nGDt9UpPzajGGI99Ogdf7 xv85WL+sVaAuGTmJ5Pt94nB+PgxlA8HxcyaP0t/Lcf0Z1gXoEXF41v26o1jW4OXa zpIRN2JBhOI86ZzfaNiAwe1svTF3xP4MfeYRMn51rmJ1p7d0fwrpRwIzJGL2Cpjc 2iIdly0lTdR0wmy3Y/pqRga0B8FwJu21CcmybymNwOuwILWhPjrfiBWRHiK8UrZ0 d3zoukzuuTh/iyN79dhBUKbXrNo8Cm6Mew1oJ2nCirQo7cKT61Kk/CSFjd+uPUfr QIZA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1697072345; x=1697158745; bh=PgwRdVog0mehW ihFWXnJss+aanw2UkXBAenOfEMTLig=; b=Ci17Kk9x9/NrRdqHIhXwkEKIw9NOR KSGDZZyvupyEDQu03/5Xs0gPAKYI5TwZ7ygZeyJPb4oGK631cz2RpOT3Gh1GQ9U3 Pp60yHG4TtAoEer8F5DhKXxzwhts1KhNHG42BipBnOJWaEt+Iyb5NCOrspDZPMDV tMB4KV+PbMh1hQxitmDqBKkMIYTkeoBCs1wG6Y9mtjnhfxWd5RH7zI2qYv7VVtxt T95DB/pnGEkBipbQEa3SJ3/FAw2MEr7O7z+piWgKCmyc3TgrXMmCeFSLx5dXh033 GU4V+DGf46b4sSz+VyGRtfu+0OryGhRRQOve5XkUFQ+G9k/euO73e7R7A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrheelgdefkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdefhedmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeejjedtleelgeegleffudfhjedt uedvkeektefhhfeuvddvueduueegfeduvedtieenucffohhmrghinhepghhithhhuhgsrd gtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhep mhhitghhrggvlhesphgrqhhuihgvrhdrgiihii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 11 Oct 2023 20:59:04 -0400 (EDT) Date: Thu, 12 Oct 2023 09:59:01 +0900 From: Michael Paquier To: Abhishek Bhola Cc: pgsql-general Subject: Re: Change error code severity for syslog? Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="OcMfnvQPBnYh/D0f" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --OcMfnvQPBnYh/D0f Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 12, 2023 at 09:42:47AM +0900, Abhishek Bhola wrote: > For most of the Postgres errors, translating it to WARNING level in syslog > works, however, I wanted to translate *ERROR codes XX000/1/2* in Postgres > to be ERROR in syslog as well, so that it triggers the alert system and I > can notified. >=20 > Is there any way to change the severity level for these specific error > codes in Postgres? You could, hypothetically, use the elog hook to switch dynamically the error data reports to something else depending on the types of filters you would like to apply to them. I have an example of this kind of idea in one of my plugin modules here: https://github.com/michaelpq/pg_plugins/tree/main/jsonlog -- Michael --OcMfnvQPBnYh/D0f Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmUnRNUACgkQnvQgOdby QH25kA//WvE84+PqRn6nKFJM4cND6bJPepvpHVQRKRBjk9sz8qVzwp2Ur12uLn9P /M9wv7Ch7jLQVKEe+YPo2ogK77VzasnIkILyXuhiyH33IlKQnKlzMQnvXojD6VSw D4Jmm/e+RW5kmKY+IRAkirUziLTv7SwY5C1VYM6tKsucHI3A4QhAoCKam/wmnNdc j7KNploqKnT+TEr0tA9hl5hvX5F6rGOfkRiaJDRatwcAF731kMA9vOQSEV/2Iu2h 3Dssk8D5rj0FUgezUvkw0gyV3pXRwqRb6asWOJSRsu5iF9ab4e2cMp7GVAkDuMTy oOc+mqdMT2CBNQH7Os0+rNBShNWt4DVgIE7OLCY7D7e1wCmGJryiXReDsJGD3W0X 1VZ7yUCZbiQ+FOgKbMDKISaNADhf5tNJbkdwsu3OclwQYVztAgNpTYwJG9k7Yy9x ghQoVZ/CjUgfk83u+t2KpR7H8Jen8HdgoXTcypfTR5m53TZB0N9ZeoVbJ7aoF747 sHGiedPvuTC7pUN5b+0WBaJTn/NDvaNYyK3+5pqdWQmzo17d7s8ps/oFtBJPqTON CKza/EIuhFZqwwQeg/YVbt/9dx0kSfjI/mn6dXqvmK2IgVb62RGho+KTOJbzSUf+ rPiyG7qUhdrOIHwZTrRKOOaHy33/4c4NW2P5SFlQ43pbWp4Fa7I= =C9cG -----END PGP SIGNATURE----- --OcMfnvQPBnYh/D0f--