Re: application for postgres Log - Mailing list pgsql-general

From John R Pierce
Subject Re: application for postgres Log
Date
Msg-id 504D92CA.1080001@hogranch.com
Whole thread Raw
In response to application for postgres Log  (Arvind Singh <arvindps@hotmail.com>)
List pgsql-general
On 09/09/12 11:19 PM, Arvind Singh wrote:
> I am in a project that uses PostGresSql v9.0. We are developing an
> application in CSharp to parse the PG server activity log installed on
> Windows 2003/XP or higher.
>
> Our application will :
> Scan the Log for a given search text and Post rows found
> Produce statistics related to SQL queries tracked in a time frame
> Will allow selection of log columns, that can be displayed in a DataGrid
>
> I need some help or even a simple link that is related to this
> subject. I am already checking Goog query of Postgres Log, though it
> gives mostly results for the postgres Documentation.

the log isn't in a column oriented format although you can define a
custom log prefix of things like timestamp, database user, connection
IP, database name, process ID, and those could be treated as columns,
according to whatever seperators you specify as part of your custom log
prefix.

past that, the log is plain text.   by default only errors and a few key
system events are logged (startup, shutdown), but you can increase the
amount of logging via the various options in postgresql.conf, including
logging all statements, all connections, etc.

whatever you do, its going to be a lot of plain text parsing, I think if
it was my job, first thing I would do is generate some sample logs and
look at them to see how to proceed.



--
john r pierce                            N 37, W 122
santa cruz ca                         mid-left coast



pgsql-general by date:

Previous
From: Arvind Singh
Date:
Subject: application for postgres Log
Next
From: "Albe Laurenz"
Date:
Subject: Re: application for postgres Log