Log Clutter

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Greg Stark

    Log Clutter


    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_region s" 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_region s" 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_region s" 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_region s" 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_region s" 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_region s" 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_region s" 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_region s" 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_region s" 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_region s" 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


    ---------------------------(end of broadcast)---------------------------
    TIP 1: subscribe and unsubscribe commands go to majordomo@postg resql.org

  • Tom Lane

    #2
    Re: Log Clutter

    Greg Stark <gsstark@mit.ed u> writes:[color=blue]
    > 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:[/color]

    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

    ---------------------------(end of broadcast)---------------------------
    TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddres sHere" to majordomo@postg resql.org)

    Comment

    • Alvaro Herrera

      #3
      Re: Log Clutter

      On Fri, Aug 20, 2004 at 12:08:45PM -0400, Greg Stark wrote:[color=blue]
      >
      > 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:[/color]

      You could execute a SET LOCAL log_error_verbo sity 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>)
      "Endurecers e, pero jamás perder la ternura" (E. Guevara)


      ---------------------------(end of broadcast)---------------------------
      TIP 5: Have you checked our extensive FAQ?



      Comment

      Working...