Re: Reducing the log spam
Laurenz Albe <laurenz.albe@cybertec.at>
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: Jelte Fennema-Nio <postgres@jeltef.nl>, Isaac Morland <isaac.morland@gmail.com>, pgsql-hackers@lists.postgresql.org
Date: 2024-06-18T16:49:36Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
plpgsql: make WHEN OTHERS distinct from WHEN SQLSTATE '00000'.
- 58fdca2204de 18.0 cited
Attachments
- v4-0001-Add-parameter-log_suppress_errcodes.patch (text/x-patch) patch v4-0001
On Mon, 2024-06-17 at 16:40 -0500, Justin Pryzby wrote: > > The feature will become much less useful if unique voilations keep getting logged. > > Uh, to be clear, your patch is changing the *defaults*, which I found > surprising, even after reaading the thread. Evidently, the current > behavior is not what you want, and you want to change it, but I'm *sure* > that whatever default you want to use at your site/with your application > is going to make someone else unhappy. I surely want unique violations > to be logged, for example. I was afraid that setting the default non-empty would cause objections. > > + <para> > > + This setting is useful to exclude error messages from the log that are > > + frequent but irrelevant. > > I think you should phrase the feature as ".. *allow* skipping error > logging for messages ... that are frequent but irrelevant for a given > site/role/DB/etc." I have reworded that part. > I suggest that this patch should not change the default behavior at all: > its default should be empty. That you, personally, would plan to > exclude this or that error code is pretty uninteresting. I think the > idea of changing the default behavior will kill the patch, and even if > you want to propose to do that, it should be a separate discussion. > Maybe you should make it an 002 patch. I have attached a new version that leaves the parameter empty by default. The patch is not motivated by my personal dislike of certain error messages. A well-written application would not need that parameter at all. The motivation for me is based on my dealing with customers' log files, which are often full of messages that are only distracting from serious problems and fill up the disk. But you are probably right that it would be hard to find a default setting that nobody has quibbles with, and the default can always be changed with a future patch. Yours, Laurenz Albe