Thread: log_min_duration_statement

log_min_duration_statement

From
Eric Brown
Date:
I set this to 250 and the statements that take longer than this are
logged... but my driver is creating all kinds of cursors, so it isn't
logging anything useful. Yet, if I log all statement
(log_statment='mod'), I get way more logging than is useful. Is there a
happy medium?

This is what I'm getting now(for example):
Jan 26 02:26:15 abacagw postgres[28359]: [22-1] LOG:  duration: 284.786
ms  statement: FETCH 1 FROM "PgSQL_A8A3BE0C"
Jan 26 02:26:15 abacagw postgres[27992]: [19-1] LOG:  duration: 254.549
ms  statement: FETCH 1 FROM "PgSQL_A8A2884C"
Jan 26 02:26:15 abacagw postgres[28432]: [11-1] LOG:  duration: 376.167
ms  statement: FETCH 1 FROM "PgSQL_A8A49CAC"
Jan 26 02:26:16 abacagw postgres[28359]: [23-1] LOG:  duration: 373.027
ms  statement: FETCH 1 FROM "PgSQL_A8A166AC"
Jan 26 02:26:16 abacagw postgres[28539]: [10-1] LOG:  duration: 278.023
ms  statement: FETCH 1 FROM "PgSQL_A8A387EC"
Jan 26 02:26:16 abacagw postgres[28361]: [24-1] LOG:  duration: 499.291
ms  statement: FETCH 1 FROM "PgSQL_A8A68F0C"
Jan 26 02:26:17 abacagw postgres[28359]: [24-1] LOG:  duration: 636.480
ms  statement: FETCH 1 FROM "PgSQL_A8A166AC"
Jan 26 02:26:17 abacagw postgres[28399]: [9-1] LOG:  duration: 369.708
ms  statement: FETCH 1 FROM "PgSQL_A89CB0AC"
Jan 26 02:26:17 abacagw postgres[28432]: [12-1] LOG:  duration: 304.065
ms  statement: FETCH 1 FROM "PgSQL_A89E1CAC"
Jan 26 02:26:17 abacagw postgres[28361]: [25-1] LOG:  duration: 252.809
ms  statement: FETCH 1 FROM "PgSQL_A8A3694C"

Eric Brown
408-571-6341
www.propel.com

Re: log_min_duration_statement

From
Lonni J Friedman
Date:
Setting the number of something higher than 250ms ?


On Wed, 26 Jan 2005 02:39:21 -0800, Eric Brown <eric.brown@propel.com> wrote:
> I set this to 250 and the statements that take longer than this are
> logged... but my driver is creating all kinds of cursors, so it isn't
> logging anything useful. Yet, if I log all statement
> (log_statment='mod'), I get way more logging than is useful. Is there a
> happy medium?
>
> This is what I'm getting now(for example):
> Jan 26 02:26:15 abacagw postgres[28359]: [22-1] LOG:  duration: 284.786
> ms  statement: FETCH 1 FROM "PgSQL_A8A3BE0C"
> Jan 26 02:26:15 abacagw postgres[27992]: [19-1] LOG:  duration: 254.549
> ms  statement: FETCH 1 FROM "PgSQL_A8A2884C"
> Jan 26 02:26:15 abacagw postgres[28432]: [11-1] LOG:  duration: 376.167
> ms  statement: FETCH 1 FROM "PgSQL_A8A49CAC"
> Jan 26 02:26:16 abacagw postgres[28359]: [23-1] LOG:  duration: 373.027
> ms  statement: FETCH 1 FROM "PgSQL_A8A166AC"
> Jan 26 02:26:16 abacagw postgres[28539]: [10-1] LOG:  duration: 278.023
> ms  statement: FETCH 1 FROM "PgSQL_A8A387EC"
> Jan 26 02:26:16 abacagw postgres[28361]: [24-1] LOG:  duration: 499.291
> ms  statement: FETCH 1 FROM "PgSQL_A8A68F0C"
> Jan 26 02:26:17 abacagw postgres[28359]: [24-1] LOG:  duration: 636.480
> ms  statement: FETCH 1 FROM "PgSQL_A8A166AC"
> Jan 26 02:26:17 abacagw postgres[28399]: [9-1] LOG:  duration: 369.708
> ms  statement: FETCH 1 FROM "PgSQL_A89CB0AC"
> Jan 26 02:26:17 abacagw postgres[28432]: [12-1] LOG:  duration: 304.065
> ms  statement: FETCH 1 FROM "PgSQL_A89E1CAC"
> Jan 26 02:26:17 abacagw postgres[28361]: [25-1] LOG:  duration: 252.809
> ms  statement: FETCH 1 FROM "PgSQL_A8A3694C"


--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
L. Friedman                                    netllama@gmail.com
LlamaLand                       http://netllama.linux-sxs.org