Re: PG Log MultiLine Records

Поиск
Список
Период
Сортировка
От Albe Laurenz
Тема Re: PG Log MultiLine Records
Дата
Msg-id D960CB61B694CF459DCFB4B0128514C20874B630@exadv11.host.magwien.gv.at
обсуждение исходный текст
Ответ на PG Log MultiLine Records  (Arvind Singh <arvindps@hotmail.com>)
Список pgsql-general
Arvind Singh wrote:
> we have been working on a CSV Log parser application in csharp.
>
> we recently discovered that certain log entries or records can span
across multiple lines.
>
> in the sense, that the same activity has more detail in subsequent
lines.

Not really, they are different log entries that belong to one
SQL statement.

For example, if you have log_statement='all' and
log_min_duration_statement=3s, then some statements will
produce one log entry and others will produce two.

> For ex, a select,insert query has
> A query entry
> A Duration entry
> A Stats entry
>
> and that is why there was a serious coding mistake in counting select
entries, because the same select
> statement
> is displayed in Query column twice and once in Detail column
>
> So our application counted them as three queries.
>
> My query is, has any of us come across more such examples or
> :: is there a link or page explaining type of Log entries

Not really, the details are in the code.

> :: Number of log statements a logentry type occupy.

I don't quite understand that.

> :: or other finer details that we may overlook
>
> it will be helpfull as we wish to release this application for all pg
users at no price.

It is hard to find a solution that works no matter how
logging is configured.

It would be helpful to know what your program is trying to achieve.

What I did for pgreplay is
a) force certain configuration settings as prerequisite
   (like log_statement='all').
b) search for log lines with severity "LOG" where the query
   entry begins with "statement: ".

That should filter out the "duration" and "stats" lines you
mention above.

Yours,
Laurenz Albe


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

Предыдущее
От: Arvind Singh
Дата:
Сообщение: PG Log MultiLine Records
Следующее
От: Benedikt Grundmann
Дата:
Сообщение: Re: Expression to construct a anonymous record with named columns?