Re: How to log query's from servers ?
От | Craig Ringer |
---|---|
Тема | Re: How to log query's from servers ? |
Дата | |
Msg-id | 4DED5832.5000208@postnewspapers.com.au обсуждение исходный текст |
Ответ на | Re: How to log query's from servers? (Condor <condor@stz-bg.com>) |
Ответы |
Re: How to log query's from servers?
|
Список | pgsql-general |
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
В списке pgsql-general по дате отправления: