Re: PostgreSQL 9.3 logging: separate log messages

From: Jason Mathis <jmathis(at)redzonesoftware(dot)com>
To: pgsql-admin(at)postgresql(dot)org <pgsql-admin(at)postgresql(dot)org>, Sergey Arlashin <sergeyarl(dot)maillist(at)gmail(dot)com>
Subject: Re: PostgreSQL 9.3 logging: separate log messages
Date: 2014-03-31 14:40:55
Message-ID: etPan.53397e77.643c9869.1a0@palos
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

I am not exactly sure how to achieve just that, but have you checked out something like https://github.com/dalibo/pgbadger?

We use it here and love it. It parses out all your queries and does a great analysis on them. I have a script that emails me a report every morning. 

-jason 

On March 31, 2014 at 7:33:39 AM, Sergey Arlashin (sergeyarl(dot)maillist(at)gmail(dot)com) wrote:

Hi!

What is the proper way to separate queries from other messages while logging?

For example:

I have 'log_min_duration_statement' parameter in postgresql.conf . Therefore I get postgresql system messages and slow queries in one log file /var/log/postgresql/postgresql-9.3-main.log .

In order to simplify further reading I'd like to get slow queries in /var/log/postgresql/postgresql-slowqueries.log and all the rest in /var/log/postgresql/postgresql.log.

I tried to implement this by means of rsyslog but didn't manage to get any decent result.

Any help will be greatly appreciated :)

--
Best regards,
Sergey Arlashin

--
Sent via pgsql-admin mailing list (pgsql-admin(at)postgresql(dot)org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

--

This transmission contains confidential and privileged information intended
solely for the party identified above. If you receive this message in
error, you must not use it or convey it to others. Please destroy it
immediately and contact the sender at (303) 386-3955 or by return e-mail to
the sender.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Adrian Klaver 2014-03-31 14:55:57 Re: [ADMIN]openvz and shared memory trouble
Previous Message Adrian Klaver 2014-03-31 14:38:31 Re: [ADMIN]openvz and shared memory trouble