Re: Logging SQL queries? - Mailing list pgsql-general

From Stephane Bortzmeyer
Subject Re: Logging SQL queries?
Date
Msg-id 20020718101601.GB30688@nic.fr
Whole thread Raw
In response to Logging SQL queries?  (Steve Lane <slane@fmpro.com>)
Responses Re: Logging SQL queries?  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general
On Tue, Jul 16, 2002 at 10:40:14PM -0500,
 Steve Lane <slane@fmpro.com> wrote
 a message of 17 lines which said:

> Ideally I'd like to capture just the queries that are submitted to the
> database. It would be rather annoying to have to log them from the
> application layer, so I'm hoping there's some suitable log-level setting on
> the back end that can do this.

A related question: does anyone has a function to call syslog()? I
would like to set up triggers which logs with the syslog system, but
only some events (so debug_print_query is not for me).

I cannot write this function in Python (because it exists only as a
safe language), I can do it in Perl but Perl in PostgreSQL does not
have global variables so I have to openlog() each time (I'm afraid,
although I didn't benchmark, that it may slow down the
system.). Before I study C or Tcl, does anyone has a working solution?

[I noticed contrib/pg_logger but it lacks documentation :-(]


pgsql-general by date:

Previous
From: Steve Brett
Date:
Subject: Appropriate values for sort_mem and shared_buffers
Next
From: Justin Clift
Date:
Subject: SysAdmin magazine is doing a "Call for Papers" about Open Sourc