Question about PostgreSQL logging configuration - Mailing list pgsql-general

From Maxim Boguk
Subject Question about PostgreSQL logging configuration
Date
Msg-id CAK-MWwR7tCJXSubo6umU=R0rdgSEQdzrYc09dha82_VzZvvUiA@mail.gmail.com
Whole thread Raw
Responses Re: Question about PostgreSQL logging configuration
List pgsql-general
Hi,

I have some interesting question about PostgreSQL logging configuration.

I want log all 'mod' statements with their execution times and all
statements longer than 10ms (also with their execution times).

Now I have 3 setting to play with:
log_min_duration_statement
log_duration
log_statement

But it seems that I could not have configuration which doing what I looking for.

Because:
log_min_duration_statement=10ms
log_duration = off
log_statement = mod
will log almost everything what I need but db did not log execution
times for mod statements in that case.

Alternatively if I try:
log_min_duration_statement=10ms
log_duration = on
log_statement = mod
db will log execution times of every query (not only mod and ones
longer 10ms) thus producing lot noise and exceptionally large log
files.

I could not keep log_min_duration_statement=0 on database with 20000+
requests per second.

Is there any good solution for that task?

--
Maxim Boguk
Senior Postgresql DBA
http://www.postgresql-consulting.ru/

Phone RU: +7 910 405 4718
Phone AU: +61 45 218 5678

Skype: maxim.boguk
Jabber: maxim.boguk@gmail.com
МойКруг: http://mboguk.moikrug.ru/

"People problems are solved with people.
If people cannot solve the problem, try technology.
People will then wish they'd listened at the first stage."


pgsql-general by date:

Previous
From: Gavan Schneider
Date:
Subject: Re: youtube video on pgsql integrity
Next
From: Tom Lane
Date:
Subject: Re: youtube video on pgsql integrity