Search Postgresql Archives

Re: PG Log MultiLine Records

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux