public inbox for [email protected]  
help / color / mirror / Atom feed
how to completely turn off statement error logging
4+ messages / 3 participants
[nested] [flat]

* how to completely turn off statement error logging
@ 2024-05-13 14:10  Zwettler Markus (OIZ) <[email protected]>
  0 siblings, 1 reply; 4+ messages in thread

From: Zwettler Markus (OIZ) @ 2024-05-13 14:10 UTC (permalink / raw)
  To: [email protected] <[email protected]>

I don't want to log statement errors in the server logfile - whether the statement string nor the error message.


I set "log_min_error_statement = panic" according to the docs:

<quote>
To effectively turn off logging of failing statements, set this parameter to PANIC.
</quote>


But error messages are still logged:

$ psql
psql (12.17)
SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384, bits: 256, compression: off)
Type "help" for help.

pcl_l300=# show log_min_error_statement;
log_min_error_statement
-------------------------
panic
(1 row)

pcl_l300=# select error_817 / 0;
ERROR:  column "error_817" does not exist
LINE 1: select error_817 / 0;
               ^
pcl_l300=# exit
$ fgrep error_817 pg_statsinfo.log
2024-05-13 16:01:14 CEST 36421 ERROR:  column "error_817" does not exist


Question: How can I turn off logging of this statement based error message?



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: how to completely turn off statement error logging
@ 2024-05-13 14:26  Tom Lane <[email protected]>
  parent: Zwettler Markus (OIZ) <[email protected]>
  0 siblings, 1 reply; 4+ messages in thread

From: Tom Lane @ 2024-05-13 14:26 UTC (permalink / raw)
  To: Zwettler Markus (OIZ) <[email protected]>; +Cc: [email protected] <[email protected]>

"Zwettler Markus (OIZ)" <[email protected]> writes:
> I don't want to log statement errors in the server logfile - whether the statement string nor the error message.

You need to set log_min_messages higher than ERROR.  You might
consider using LOG or FATAL rather than PANIC, though.

> I set "log_min_error_statement = panic" according to the docs:
> To effectively turn off logging of failing statements, set this parameter to PANIC.

This setting controls whether the STATEMENT: detail is appended to a
message, but not the basic choice of whether to emit the message.

			regards, tom lane






^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* AW: [Extern] Re: how to completely turn off statement error logging
@ 2024-05-13 15:00  Zwettler Markus (OIZ) <[email protected]>
  parent: Tom Lane <[email protected]>
  0 siblings, 1 reply; 4+ messages in thread

From: Zwettler Markus (OIZ) @ 2024-05-13 15:00 UTC (permalink / raw)
  To: Tom Lane <[email protected]>; +Cc: [email protected] <[email protected]>

> Von: Tom Lane <[email protected]>
> Gesendet: Montag, 13. Mai 2024 16:26
> An: Zwettler Markus (OIZ) <[email protected]>
> Cc: [email protected]
> Betreff: [Extern] Re: how to completely turn off statement error logging
> 
> "Zwettler Markus (OIZ)" <[email protected]> writes:
> > I don't want to log statement errors in the server logfile - whether the statement
> string nor the error message.
> 
> You need to set log_min_messages higher than ERROR.  You might consider
> using LOG or FATAL rather than PANIC, though.
> 
> > I set "log_min_error_statement = panic" according to the docs:
> > To effectively turn off logging of failing statements, set this parameter to
> PANIC.
> 
> This setting controls whether the STATEMENT: detail is appended to a message,
> but not the basic choice of whether to emit the message.
> 
>                         regards, tom lane
> --- Externe Email: Vorsicht mit Anhängen, Links oder dem Preisgeben von
> Informationen ---



please let me refine.

I would like to suppress all errors in the server logfile coming from client applications, i.e. statement level errors such as "duplicate key violates..."

but I do not want to suppress errors that are related to infrastructure problems, i.e. "could not open file..."

if I set log_min_messages higher than ERROR, errors concerning the infrastructure would also be suppressed, wouldn't they?

thanks, markus


^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: how to completely turn off statement error logging
@ 2024-05-13 15:14  David G. Johnston <[email protected]>
  parent: Zwettler Markus (OIZ) <[email protected]>
  0 siblings, 0 replies; 4+ messages in thread

From: David G. Johnston @ 2024-05-13 15:14 UTC (permalink / raw)
  To: Zwettler Markus (OIZ) <[email protected]>; +Cc: Tom Lane <[email protected]>; [email protected] <[email protected]>

On Monday, May 13, 2024, Zwettler Markus (OIZ) <[email protected]>
wrote:
>
>
> but I do not want to suppress errors that are related to infrastructure
> problems, i.e. "could not open file..."
>
>
The server doesn’t classify the errors it emits into scope, “application
errors” and ”infrastructure errors”, or otherwise.  The only classification
is severity.

It does include an SQL Error Code that you could, in post-processing, act
on.

David J.


^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2024-05-13 15:14 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-05-13 14:10 how to completely turn off statement error logging Zwettler Markus (OIZ) <[email protected]>
2024-05-13 14:26 ` Tom Lane <[email protected]>
2024-05-13 15:00   ` AW: [Extern] Re: how to completely turn off statement error logging Zwettler Markus (OIZ) <[email protected]>
2024-05-13 15:14     ` David G. Johnston <[email protected]>

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