Re: How to log query's from servers ?

From: Condor <condor(at)stz-bg(dot)com>
To: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to log query's from servers ?
Date: 2011-06-07 12:13:56
Message-ID: 6dd5261723283881ff6f888d4fbeecbd@stz-bg.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 07 Jun 2011 06:44:02 +0800, Craig Ringer wrote:
> On 06/06/2011 09:26 PM, Condor wrote:
>
>> Can you explain little more how i can use database-level or
>> user-level
>> SET commands to set log_statement for only one of them ?
>
> http://www.postgresql.org/docs/current/static/sql-set.html
>
> http://www.postgresql.org/docs/current/static/runtime-config-logging.html
> http://www.postgresql.org/docs/current/static/sql-alteruser.html
> http://www.postgresql.org/docs/current/static/sql-alterdatabase.html
>
> You might, for example:
>
> ALTER USER user1 SET log_statement = 'all';
> ALTER USER user2 SET log_statement = 'none';
>
> or do the same with ALTER DATABASE ... SET if you wanted to log on a
> per-database level.
>
>> Probably, a little filter or patch on postgresql source code file
>> which
>> manage logs to write log file
>> only if ip is the ip that i want will save me.
>
>
> Rather than patching PostgreSQL I would recommend configuring
> PostgreSQL to log through a smarter syslog daemon like rsyslogd or
> syslogd-ng . You should then be able to use regular expression
> filters
> in the syslog daemon to discard log messages you are not interested
> in
> before they are written to disk.
>
> --
> Craig Ringer

Thank you to you and Scott for help.
--
Regards,
Condor

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Юрий EGO 2011-06-07 12:46:17
Previous Message Pavel Stehule 2011-06-07 11:48:38 Re: maximum size limit for a query string?