pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Abhishek Bhola <abhishek.bhola@japannext.co.jp>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: Change error code severity for syslog?
Date: Thu, 12 Oct 2023 09:59:01 +0900
Message-ID: <ZSdE1bKxZl49pfcX@paquier.xyz> (raw)
In-Reply-To: <CAEDsCzg0Lv7qvMiL1hg6Xo0KnYoPLrh1ZR7CKMdFdHOd9Dqa9A@mail.gmail.com>
References: <CAEDsCzg0Lv7qvMiL1hg6Xo0KnYoPLrh1ZR7CKMdFdHOd9Dqa9A@mail.gmail.com>

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

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (2+ messages)

Message-ID: <ZSdE1bKxZl49pfcX@paquier.xyz>
Permalink:  ../ZSdE1bKxZl49pfcX@paquier.xyz/
Also on:    postgresql.org/message-id/ZSdE1bKxZl49pfcX@paquier.xyz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: michael@paquier.xyz, abhishek.bhola@japannext.co.jp
  Subject: Re: Change error code severity for syslog?
  In-Reply-To: <ZSdE1bKxZl49pfcX@paquier.xyz>
  References: <CAEDsCzg0Lv7qvMiL1hg6Xo0KnYoPLrh1ZR7CKMdFdHOd9Dqa9A@mail.gmail.com> <ZSdE1bKxZl49pfcX@paquier.xyz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox