Re: Change error code severity for syslog?

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Abhishek Bhola <abhishek(dot)bhola(at)japannext(dot)co(dot)jp>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Change error code severity for syslog?
Date: 2023-10-12 00:59:01
Message-ID: ZSdE1bKxZl49pfcX@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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.
>
> 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sepideh Eidi 2023-10-12 06:09:40 Question About PostgreSQL Extensibility
Previous Message Abhishek Bhola 2023-10-12 00:42:47 Change error code severity for syslog?