pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: David G. Johnston <david.g.johnston@gmail.com>
To: Andrew Bartley <ambartley@gmail.com>
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: Logging
Date: Tue, 12 Jun 2018 21:12:51 -0700
Message-ID: <6b3a4185-611e-5576-d5f8-ec036f67ba86@aklaver.com> (raw)
In-Reply-To: <CAKFQuwYFMPEvJwvjKAo-QFbu_cUTVN7aX6bkp345RT4zRnZq_w@mail.gmail.com>
References: <CAA3RN+zZPxhZOd4NNpW==929pVy809hcbbjH-vk4hJbu_ch2zQ@mail.gmail.com>
	<1528857807.2657.3.camel@cybertec.at>
	<CAA3RN+zwDSvjarTtzKNo1Y++NMcU-LWwZS9JsZs0FM7mfNJu+Q@mail.gmail.com>
	<CAKFQuwYFMPEvJwvjKAo-QFbu_cUTVN7aX6bkp345RT4zRnZq_w@mail.gmail.com>

On 06/12/2018 08:25 PM, David G. Johnston wrote:
> On Tuesday, June 12, 2018, Andrew Bartley <ambartley@gmail.com 
> <mailto:ambartley@gmail.com>> wrote:
> 
> 
> 
>     On Wed, 13 Jun 2018 at 12:43 Laurenz Albe <laurenz.albe@cybertec.at
>     <mailto:laurenz.albe@cybertec.at>> wrote:
> 
> 
>         log_min_duration_statement = 0
> 
> [...]
> 
> 
>     log_min_duration_statement -1
> 
> 
> You've disabled statement logging altogether.  The zero value you were 
> directed to use is what causes everything to be logged.

Actually no:

https://www.postgresql.org/docs/10/static/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-WHEN

log_min_duration_statement (integer)

"... Setting this to zero prints all statement durations. Minus-one (the 
default) disables logging statement durations.  ..."

"

So -1 only affects logging statements relative to duration.

If you have log_statements set then you will still get statements logged 
if you have log_min_duration_statement = -1 :

Note

When using this option together with log_statement, the text of 
statements that are logged because of log_statement will not be repeated 
in the duration log message.
"

This is how I have my logging setup, log_min_duration_statement = -1
and log_statements = 'mod' and I see statements in the logs.

> 
> David J.
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com




view thread (15+ messages)  latest in thread

Message-ID: <6b3a4185-611e-5576-d5f8-ec036f67ba86@aklaver.com>
Permalink:  ../6b3a4185-611e-5576-d5f8-ec036f67ba86@aklaver.com/
Also on:    postgresql.org/message-id/6b3a4185-611e-5576-d5f8-ec036f67ba86@aklaver.com

 · 

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: adrian.klaver@aklaver.com, david.g.johnston@gmail.com, ambartley@gmail.com
  Subject: Re: Logging
  In-Reply-To: <6b3a4185-611e-5576-d5f8-ec036f67ba86@aklaver.com>
  References: <CAA3RN+zZPxhZOd4NNpW==929pVy809hcbbjH-vk4hJbu_ch2zQ@mail.gmail.com> <1528857807.2657.3.camel@cybertec.at> <CAA3RN+zwDSvjarTtzKNo1Y++NMcU-LWwZS9JsZs0FM7mfNJu+Q@mail.gmail.com> <CAKFQuwYFMPEvJwvjKAo-QFbu_cUTVN7aX6bkp345RT4zRnZq_w@mail.gmail.com> <6b3a4185-611e-5576-d5f8-ec036f67ba86@aklaver.com>

* 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