From: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
---|---|
To: | Jim Jones <jim(dot)jones(at)uni-muenster(dot)de> |
Cc: | Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, pgsql-hackers(at)lists(dot)postgresql(dot)org |
Subject: | Re: Reducing the log spam |
Date: | 2024-03-05 13:57:05 |
Message-ID: | CAFj8pRAEo0fg24s_aHssttF8beu5nA+HnvyJcm5UKHgRsKRTKA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi
út 5. 3. 2024 v 14:55 odesílatel Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>
napsal:
> Hi Laurenz
>
> On 05.03.24 13:55, Laurenz Albe wrote:
> > Inspired by feedback to [1], I thought about how to reduce log spam.
> >
> > My experience from the field is that a lot of log spam looks like
> >
> > database/table/... "xy" does not exist
> > duplicate key value violates unique constraint "xy"
> >
> > So what about a parameter "log_suppress_sqlstates" that suppresses
> > logging ERROR and FATAL messages with the enumerated SQL states?
> >
> > My idea for a default setting would be something like
> >
> > log_suppress_sqlstates = '23505,3D000,3F000,42601,42704,42883,42P01'
> >
> > but that's of course bikeshedding territory.
> >
> > Yours,
> > Laurenz Albe
> >
> >
> >
> > [1]:
> https://postgr.es/m/b8b8502915e50f44deb111bc0b43a99e2733e117.camel%40cybertec.at
>
> I like this idea, and I could see myself using it a lot in some projects.
>
> Additionally, it would be nice to also have the possibility suppress a
> whole class instead of single SQL states, e.g.
>
> log_suppress_sqlstates = 'class_08' to suppress these all at once:
>
> 08000 connection_exception
> 08003 connection_does_not_exist
> 08006 connection_failure
> 08001 sqlclient_unable_to_establish_sqlconnection
> 08004 sqlserver_rejected_establishment_of_sqlconnection
> 08007 transaction_resolution_unknown
> 08P01 protocol_violation
>
>
It can take code from PLpgSQL.
Regards
Pavel
> Best regards,
> Jim
>
>
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Jelte Fennema-Nio | 2024-03-05 14:03:54 | Re: Improve readability by using designated initializers when possible |
Previous Message | Jim Jones | 2024-03-05 13:55:21 | Re: Reducing the log spam |