Re: [GENERAL] Matching statement and duration log lines

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [GENERAL] Matching statement and duration log lines
Дата
Msg-id 20180129161549.GD11620@momjian.us
обсуждение исходный текст
Ответ на [GENERAL] Matching statement and duration log lines  (Popov Aleksey <Aleksey.Popov@annalect.omd.ru>)
Список pgsql-general
On Mon, Oct 23, 2017 at 01:06:07PM +0000, Popov Aleksey wrote:
> Hello!
> 
> I am sending PG logs to Elasticsearch and want to merge a line with statement
> and a line with duration into one document.
> Having a statement line and a duration line, can I assume that if a session ids
> (%c) of these lines match,
> and numbers of log lines (%l) are consecutive, then the duration line belongs
> to statement line?

Very late reply here, but setting log_min_duration_statement to zero
will give you those on one line, but the statement will only be output
when it completes, rather than when it starts, which is what
log_statement does.

And, yes, using %c to match up lines will work too.

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

+ As you are, so once was I.  As I am, so you will be. +
+                      Ancient Roman grave inscription +


В списке pgsql-general по дате отправления:

Предыдущее
От: Steve Crawford
Дата:
Сообщение: Re: Which specific flags to use for bash client applications forDaVinci Resolve?
Следующее
От: Konstantin Gredeskoul
Дата:
Сообщение: Re: PG Sharding