pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedPostgreSQL 9.3 logging: separate log messages
3+ messages / 3 participants
[nested] [flat]
* PostgreSQL 9.3 logging: separate log messages
@ 2014-03-31 13:33 Sergey Arlashin <sergeyarl.maillist@gmail.com>
2014-03-31 14:40 ` Re: PostgreSQL 9.3 logging: separate log messages Jason Mathis <jmathis@redzonesoftware.com>
2014-04-01 00:49 ` Re: PostgreSQL 9.3 logging: separate log messages Venkata Balaji Nagothi <vbnpgc@gmail.com>
0 siblings, 2 replies; 3+ messages in thread
From: Sergey Arlashin @ 2014-03-31 13:33 UTC (permalink / raw)
To: pgsql-admin
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@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: PostgreSQL 9.3 logging: separate log messages
2014-03-31 13:33 PostgreSQL 9.3 logging: separate log messages Sergey Arlashin <sergeyarl.maillist@gmail.com>
@ 2014-03-31 14:40 ` Jason Mathis <jmathis@redzonesoftware.com>
1 sibling, 0 replies; 3+ messages in thread
From: Jason Mathis @ 2014-03-31 14:40 UTC (permalink / raw)
To: pgsql-admin; Sergey Arlashin <sergeyarl.maillist@gmail.com>
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.maillist@gmail.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@postgresql.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.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: PostgreSQL 9.3 logging: separate log messages
2014-03-31 13:33 PostgreSQL 9.3 logging: separate log messages Sergey Arlashin <sergeyarl.maillist@gmail.com>
@ 2014-04-01 00:49 ` Venkata Balaji Nagothi <vbnpgc@gmail.com>
1 sibling, 0 replies; 3+ messages in thread
From: Venkata Balaji Nagothi @ 2014-04-01 00:49 UTC (permalink / raw)
To: Sergey Arlashin <sergeyarl.maillist@gmail.com>; +Cc: pgsql-admin
On Tue, Apr 1, 2014 at 12:33 AM, Sergey Arlashin <
sergeyarl.maillist@gmail.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.
>
AFAIK, there is no such mechanism which would help you log different types
of messages to separate logfiles.
If you like to separate messages in the logfile - you need to either have
an offline process (like perl or shell script) which would help you
identify and separate the types of messages logged and generate two
different logfiles.
In a much simpler way - if your only concern is to log slow queries, then
reporting tools like pgbadger or pg_query_analyzer or pgsi would help you
do so.
Regards,
Venkata Balaji N
Fujitsu Australia
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2014-04-01 00:49 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2014-03-31 13:33 PostgreSQL 9.3 logging: separate log messages Sergey Arlashin <sergeyarl.maillist@gmail.com>
2014-03-31 14:40 ` Jason Mathis <jmathis@redzonesoftware.com>
2014-04-01 00:49 ` Venkata Balaji Nagothi <vbnpgc@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox