Search Postgresql Archives

Re: How to log query's from servers ?

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

 



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

--
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