Обсуждение: Log Clutter

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

Log Clutter

От
Greg Stark
Дата:
Incidentally, am I the only one that finds the new 7.4 log messages too
cluttered? In 7.3 my application printed progress messages using "raise
notice" like this:

2004-08-20 11:58:16 [4369] NOTICE:  Processing 6561 1/15127...
2004-08-20 11:58:19 [4369] NOTICE:  Processing 6561 1/15127...Done Found 3800
2004-08-20 11:58:19 [4369] NOTICE:  Processing 6794 2/15127...
2004-08-20 11:58:20 [4369] NOTICE:  Processing 6794 2/15127...Done Found 4000
2004-08-20 11:58:20 [4369] NOTICE:  Processing 10045 3/15127...
2004-08-20 11:58:20 [4369] NOTICE:  Processing 10045 3/15127...Done Found 0
2004-08-20 11:58:20 [4369] NOTICE:  Processing 12325 4/15127...
2004-08-20 11:58:20 [4369] NOTICE:  Processing 12325 4/15127...Done Found 0
2004-08-20 11:58:20 [4369] NOTICE:  Processing 14957 5/15127...
2004-08-20 11:58:20 [4369] NOTICE:  Processing 14957 5/15127...Done Found 0

In 7.4 it helpfully tells me what function and line number is executing, but
since it's always the same it's pretty useless:

2004-08-20 11:58:16 [4369] NOTICE:  Processing 6561 1/15127...
CONTEXT:  PL/pgSQL function "process_regions" line 2 at return
STATEMENT:  select process_regions();
2004-08-20 11:58:19 [4369] NOTICE:  Processing 6561 1/15127...Done Found 3800
CONTEXT:  PL/pgSQL function "process_regions" line 2 at return
STATEMENT:  select process_regions();
2004-08-20 11:58:19 [4369] NOTICE:  Processing 6794 2/15127...
CONTEXT:  PL/pgSQL function "process_regions" line 2 at return
STATEMENT:  select process_regions();
2004-08-20 11:58:20 [4369] NOTICE:  Processing 6794 2/15127...Done Found 4000
CONTEXT:  PL/pgSQL function "process_regions" line 2 at return
STATEMENT:  select process_regions();
2004-08-20 11:58:20 [4369] NOTICE:  Processing 10045 3/15127...
CONTEXT:  PL/pgSQL function "process_regions" line 2 at return
STATEMENT:  select process_regions();
2004-08-20 11:58:20 [4369] NOTICE:  Processing 10045 3/15127...Done Found 0
CONTEXT:  PL/pgSQL function "process_regions" line 2 at return
STATEMENT:  select process_regions();
2004-08-20 11:58:20 [4369] NOTICE:  Processing 12325 4/15127...
CONTEXT:  PL/pgSQL function "process_regions" line 2 at return
STATEMENT:  select process_regions();
2004-08-20 11:58:20 [4369] NOTICE:  Processing 12325 4/15127...Done Found 0
CONTEXT:  PL/pgSQL function "process_regions" line 2 at return
STATEMENT:  select process_regions();
2004-08-20 11:58:20 [4369] NOTICE:  Processing 14957 5/15127...
CONTEXT:  PL/pgSQL function "process_regions" line 2 at return
STATEMENT:  select process_regions();
2004-08-20 11:58:20 [4369] NOTICE:  Processing 14957 5/15127...Done Found 0
CONTEXT:  PL/pgSQL function "process_regions" line 2 at return
STATEMENT:  select process_regions();

It also seems to print these after almost every query I have. That's because I
use SQL functions lang_en()/lang_fr() to handle l10n. It also seems too
chatty.

2004-08-18 21:25:50 [16741] LOG:  statement: select $1 [1]
CONTEXT:  SQL function "lang_en" during inlining
2004-08-18 21:25:50 [16741] LOG:  statement: select $1 [1]
CONTEXT:  SQL function "lang_en" during inlining
2004-08-18 21:25:50 [16741] LOG:  statement: select $1 [1]
CONTEXT:  SQL function "lang_en" during inlining
2004-08-18 21:25:50 [16741] LOG:  statement: select $1 [1]
CONTEXT:  SQL function "lang_en" during inlining
2004-08-18 21:25:50 [16741] LOG:  statement: select $1 [1]
CONTEXT:  SQL function "lang_en" during inlining
2004-08-18 21:25:50 [16741] LOG:  statement: select $1 [1]
CONTEXT:  SQL function "lang_en" during inlining
2004-08-18 21:25:50 [16741] LOG:  statement: select $1 [1]
CONTEXT:  SQL function "lang_en" during inlining

As far as I can see there's no way to disable either of these two cases
without disabling a lot more messages along with them. It would be nice...

--
greg

Re: Log Clutter

От
Tom Lane
Дата:
Greg Stark <gsstark@mit.edu> writes:
> Incidentally, am I the only one that finds the new 7.4 log messages too
> cluttered? In 7.3 my application printed progress messages using "raise
> notice" like this:

We could have RAISE suppress all context. (I think at the moment it only
suppresses the first level of context, which is probably a compromise
that doesn't satisfy anybody.)  I'd be inclined to do that only for the
non-error forms of RAISE, though.

            regards, tom lane

Re: Log Clutter

От
Alvaro Herrera
Дата:
On Fri, Aug 20, 2004 at 12:08:45PM -0400, Greg Stark wrote:
>
> Incidentally, am I the only one that finds the new 7.4 log messages too
> cluttered? In 7.3 my application printed progress messages using "raise
> notice" like this:

You could execute a SET LOCAL log_error_verbosity within the function to
decrease the verbosity ... the problem is that only a superuser can do
that, but maybe using a SECURITY DEFINER function to do it for you
helps.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Endurecerse, pero jamás perder la ternura" (E. Guevara)