Logging statement/duration on the same line

Поиск
Список
Период
Сортировка
Искать

Logging statement/duration on the same line

От:
Baron Schwartz <baron@xaprb.com>
Дата:
I'm writing a log parser front-end.  I've seen some log samples that
look like this, with the duration and statement on the same line:

LOG:  duration: 1.565 ms  statement: SELECT * FROM users WHERE user_id='692'

But in my 8.3.9 test installation, durations are always logged on a
separate line.  Is the sample above from a different version?  Or is
there a way to get this output with different configuration?  Here's
the type of output that I see in 8.3.9:

2010-02-08 15:31:50.872 EST LOG:  statement: select 1;
2010-02-08 15:31:50.881 EST LOG:  duration: 10.870 ms

-- 
Baron Schwartz
Percona Inc: Services and Support for MySQL
http://www.percona.com/

Re: Logging statement/duration on the same line

От:
hubert depesz lubaczewski <depesz@depesz.com>
Дата:
On Wed, Feb 10, 2010 at 12:55:03PM -0500, Baron Schwartz wrote:
> I'm writing a log parser front-end.  I've seen some log samples that
> look like this, with the duration and statement on the same line:
> 
> LOG:  duration: 1.565 ms  statement: SELECT * FROM users WHERE user_id='692'
> 
> But in my 8.3.9 test installation, durations are always logged on a
> separate line.  Is the sample above from a different version?  Or is
> there a way to get this output with different configuration?  Here's
> the type of output that I see in 8.3.9:
> 
> 2010-02-08 15:31:50.872 EST LOG:  statement: select 1;
> 2010-02-08 15:31:50.881 EST LOG:  duration: 10.870 ms

turn off log_Statement and log_duration. instead set to 0
log_min_duration_statement.

depesz

-- 
Linkedin: http://www.linkedin.com/in/depesz  /  blog: http://www.depesz.com/
jid/gtalk: depesz@depesz.com / aim:depeszhdl / skype:depesz_hdl / gg:6749007

Re: Logging statement/duration on the same line

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Baron Schwartz  writes:
> I'm writing a log parser front-end.  I've seen some log samples that
> look like this, with the duration and statement on the same line:

> LOG:  duration: 1.565 ms  statement: SELECT * FROM users WHERE user_id='692'

> But in my 8.3.9 test installation, durations are always logged on a
> separate line.  Is the sample above from a different version?  Or is
> there a way to get this output with different configuration?

If the statement text was already printed due to log_statement,
duration logging doesn't repeat it.  So if you prefer that type of
display, turn off log_statement and instead set
log_min_duration_statement = 0 to log everything via duration logging.

			regards, tom lane

Re: Logging statement/duration on the same line

От:
Baron Schwartz <baron@xaprb.com>
Дата:
Thanks Tom, Depesz,

On Wed, Feb 10, 2010 at 1:15 PM, Tom Lane  wrote:
> turn off log_statement and instead set
> log_min_duration_statement = 0 to log everything via duration logging.

That does the trick.  Time to write more test cases.

Thanks
Baron
FAQ