Hi,

If we set shared_preload_libraries or local_preload_libraries to
load some modules, "loaded library" messages are logged in server
log every new connections and autovacuum workers.

LOG: loaded library "pg_stat_statements"

Messages by shared_preload_libraries are logged only once
on non-EXEC_BACKEND platforms, but many times on Windows.
On the other hand, local_preload_libraries outputs logs
meny times in all platforms.

Is it too noisy? How about reducing the log level to DEBUG
and/or logging them only in postmaster?

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center

Search Discussions

  • Tom Lane at Jan 5, 2009 at 3:05 am

    ITAGAKI Takahiro writes:
    If we set shared_preload_libraries or local_preload_libraries to
    load some modules, "loaded library" messages are logged in server
    log every new connections and autovacuum workers.
    LOG: loaded library "pg_stat_statements"
    Yeah, I was noticing that myself while testing pg_stat_statements.
    I agree that we should fix it to reduce the message level for reloads
    occurring in child processes. I'd suggest using DEBUG2 if
    (IsUnderPostmaster && process_shared_preload_libraries_in_progress).
    I'm not so enthused about eliminating messaging for
    local_preload_libraries, though.

    regards, tom lane
  • ITAGAKI Takahiro at Jan 5, 2009 at 2:55 pm

    Tom Lane wrote:

    ITAGAKI Takahiro <itagaki.takahiro@oss.ntt.co.jp> writes:
    If we set shared_preload_libraries or local_preload_libraries to
    load some modules, "loaded library" messages are logged in server
    log every new connections and autovacuum workers.
    Yeah, I was noticing that myself while testing pg_stat_statements.
    I agree that we should fix it to reduce the message level for reloads
    occurring in child processes. I'd suggest using DEBUG2 if
    (IsUnderPostmaster && process_shared_preload_libraries_in_progress).
    I'm not so enthused about eliminating messaging for
    local_preload_libraries, though.
    Here is a patch to do it.

    Index: src/backend/utils/init/miscinit.c
    ===================================================================
    --- src/backend/utils/init/miscinit.c (HEAD)
    +++ src/backend/utils/init/miscinit.c (fixed)
    @@ -1146,6 +1146,7 @@
    char *rawstring;
    List *elemlist;
    ListCell *l;
    + int elevel;

    if (libraries == NULL || libraries[0] == '\0')
    return; /* nothing to do */
    @@ -1166,6 +1167,11 @@
    return;
    }

    + if (IsUnderPostmaster && process_shared_preload_libraries_in_progress)
    + elevel = DEBUG2;
    + else
    + elevel = LOG;
    +
    foreach(l, elemlist)
    {
    char *tok = (char *) lfirst(l);
    @@ -1185,7 +1191,7 @@
    filename = expanded;
    }
    load_file(filename, restricted);
    - ereport(LOG,
    + ereport(elevel,
    (errmsg("loaded library \"%s\"", filename)));
    pfree(filename);
    }

    Regards,
    ---
    ITAGAKI Takahiro
    NTT Open Source Software Center
  • Tom Lane at Jan 5, 2009 at 1:58 pm

    ITAGAKI Takahiro writes:
    Tom Lane wrote:
    Yeah, I was noticing that myself while testing pg_stat_statements.
    I agree that we should fix it to reduce the message level for reloads
    occurring in child processes. I'd suggest using DEBUG2 if
    (IsUnderPostmaster && process_shared_preload_libraries_in_progress).
    I'm not so enthused about eliminating messaging for
    local_preload_libraries, though.
    Here is a patch to do it.
    Applied, thanks.

    regards, tom lane

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-hackers @
categoriespostgresql
postedJan 5, '09 at 2:06a
activeJan 5, '09 at 2:55p
posts4
users2
websitepostgresql.org...
irc#postgresql

2 users in discussion

ITAGAKI Takahiro: 2 posts Tom Lane: 2 posts

People

Translate

site design / logo © 2021 Grokbase