Обсуждение: Postgres8.2 - turning off BINGLOG/PARSELOG

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

Postgres8.2 - turning off BINGLOG/PARSELOG

От
Mario Splivalo
Дата:
I'm finaly switching to 8.2. I notice that ugly 'feature' from pg8.1 has
been fixed: logging the parametars of prepared statements. It's a bit
ugly, but it's there :)

But now in my log i have BINDLOG, PARSELOG and others, and my log looks
realy cloged. Here is an example. I'm calling the
'create_mo_sms_message' function via JDBC, and this is the log entry:

2007-06-19 16:22:15.553 CEST [4596] <octopussy2> BINDLOG:  duration:
0.023 ms  bind S_1: BEGIN
2007-06-19 16:22:15.553 CEST [4596] <octopussy2> BEGINLOG:  duration:
0.010 ms  execute S_1: BEGIN
2007-06-19 16:22:15.553 CEST [4596] <octopussy2> PARSELOG:  duration:
0.165 ms  parse <unnamed>: select * from create_mo_sms_message($1, $2,
$3, $4, $5, $6, $7, $8, $9, $10, $11) as result
2007-06-19 16:22:15.553 CEST [4596] <octopussy2> BINDLOG:  duration:
0.292 ms  bind <unnamed>: select * from create_mo_sms_message($1, $2,
$3, $4, $5, $6, $7, $8, $9, $10, $11) as result
2007-06-19 16:22:15.553 CEST [4596] <octopussy2> BINDDETAIL:
parameters: $1 = NULL, $2 = 'a9369fa8-2bd9-41f0-a325-cd0fe62fbe46', $3 =
'+38598111111', $4 = 'PULITZER-1', $5 = 'memo Ovo je moja mala
probetina...', $6 = '2007-06-19 14:22:15.547', $7 = NULL, $8 = NULL, $9
= '127.0.0.1', $10 = 'tele2', $11 = NULL
2007-06-19 16:22:15.554 CEST [4596] <octopussy2> SELECTNOTICE:
__internal__determine_operator_id: Operator_mark >tele2< does not
exists!
2007-06-19 16:22:15.554 CEST [4596] <octopussy2> SELECTCONTEXT:
PL/pgSQL function "create_mo_sms_message" line 24 at assignment
2007-06-19 16:22:15.554 CEST [4596] <octopussy2> SELECTNOTICE:
CREATE_MO: Operator_id could not be guessed...
2007-06-19 16:22:15.554 CEST [4596] <octopussy2> SELECTLOG:  duration:
0.599 ms  execute <unnamed>: select * from create_mo_sms_message($1, $2,
$3, $4, $5, $6, $7, $8, $9, $10, $11) as result
2007-06-19 16:22:15.554 CEST [4596] <octopussy2> SELECTDETAIL:
parameters: $1 = NULL, $2 = 'a9369fa8-2bd9-41f0-a325-cd0fe62fbe46', $3 =
'+38598111111', $4 = 'PULITZER-1', $5 = 'memo Ovo je moja mala
probetina...', $6 = '2007-06-19 14:22:15.547', $7 = NULL, $8 = NULL, $9
= '127.0.0.1', $10 = 'tele2', $11 = NULL
2007-06-19 16:22:15.555 CEST [4596] <octopussy2> BINDLOG:  duration:
0.027 ms  bind S_2: COMMIT
2007-06-19 16:22:15.556 CEST [4596] <octopussy2> COMMITLOG:  duration:
0.029 ms  execute S_2: COMMIT


These are the settings from postgresql.conf, concerning loging:

log_min_messages = info
log_min_duration_stateme
log_error_verbosity = defaultnt = 0
debug_print_parse = off
debug_print_rewritten = off
debug_pretty_print = off
log_line_prefix = '%m [%p] <%d> %i'

Is there a way to turn off these PARSELOG and BINDLOG messages? I realy
need only the SELECTLOG (and SELECTDETAIL because there are the actuall
parametars)?

Tia,

    Mario


Re: Postgres8.2 - turning off BINGLOG/PARSELOG

От
Alvaro Herrera
Дата:
Mario Splivalo wrote:
> I'm finaly switching to 8.2. I notice that ugly 'feature' from pg8.1 has
> been fixed: logging the parametars of prepared statements. It's a bit
> ugly, but it's there :)

> 2007-06-19 16:22:15.555 CEST [4596] <octopussy2> BINDLOG:  duration:
> 0.027 ms  bind S_2: COMMIT
> 2007-06-19 16:22:15.556 CEST [4596] <octopussy2> COMMITLOG:  duration:
> 0.029 ms  execute S_2: COMMIT
>
> log_line_prefix = '%m [%p] <%d> %i'

One thing you should be aware of is that PARSELOG etc are really "PARSE"
and "LOG", but there is no intervening space since you put no space at
the end of log_line_prefix.  So I suggest changing it to

log_line_prefix = '%m [%p] <%d> %i '

Now, regarding your question,

> Is there a way to turn off these PARSELOG and BINDLOG messages? I realy
> need only the SELECTLOG (and SELECTDETAIL because there are the actuall
> parametars)?

I don't think so.  You can increase log_min_duration_statement a bit so
that only statements that take "long" are logged.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

Re: Postgres8.2 - turning off BINGLOG/PARSELOG

От
Mario Splivalo
Дата:
On Tue, 2007-06-19 at 10:52 -0400, Alvaro Herrera wrote:
> Mario Splivalo wrote:
> > I'm finaly switching to 8.2. I notice that ugly 'feature' from pg8.1 has
> > been fixed: logging the parametars of prepared statements. It's a bit
> > ugly, but it's there :)
>
> > 2007-06-19 16:22:15.555 CEST [4596] <octopussy2> BINDLOG:  duration:
> > 0.027 ms  bind S_2: COMMIT
> > 2007-06-19 16:22:15.556 CEST [4596] <octopussy2> COMMITLOG:  duration:
> > 0.029 ms  execute S_2: COMMIT
> >
> > log_line_prefix = '%m [%p] <%d> %i'
>
> One thing you should be aware of is that PARSELOG etc are really "PARSE"
> and "LOG", but there is no intervening space since you put no space at
> the end of log_line_prefix.  So I suggest changing it to
>
> log_line_prefix = '%m [%p] <%d> %i '

Huh, thnx! :) Silly me, I tought that %i actually stands for 'SELECT *
FROM ...' :)

> Now, regarding your question,
>
> > Is there a way to turn off these PARSELOG and BINDLOG messages? I realy
> > need only the SELECTLOG (and SELECTDETAIL because there are the actuall
> > parametars)?
>
> I don't think so.  You can increase log_min_duration_statement a bit so
> that only statements that take "long" are logged.

Why not? I need to have log_min_duration_statement set to 0 because I do
want every SQL sent to the postgres loged. It's essential in debugging.
But since for every SELECT i have at least 3 lines in my log file,
debugging is much harder (ok, not that harder, but still, it would be
much easier without it). It would be realy nice if one could turn that
off.

When I switch to JDBC driver for pg (pg74.215.jdbc3.jar), I have single
SELECT in a log for a SELECT sent from the client. I guess that's
because there is no prepared statements in pg74.215.jdbc3.jar, but that
is for pg-jdbc mailinglist.

10x again!

    Mike