Re: [GENERAL] Postgres logs to syslog LOCAL0

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: han(dot)holl(at)informationslogik(dot)nl
Cc: pgsql-bugs(at)postgreSQL(dot)org
Subject: Re: [GENERAL] Postgres logs to syslog LOCAL0
Date: 2005-10-14 17:05:53
Message-ID: 23465.1129309553@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-general

[ redirecting to a more appropriate list ]

han(dot)holl(at)informationslogik(dot)nl writes:
> I've noticed that, even though I specified LOCAL5 as syslog facility, postgres
> nevertheless logs _some_ events to LOCAL0.

I've thought of a theory about this: if the first write_syslog() call
occurs before guc.c has read the config file and set Syslog_facility
to LOCAL5, then the facility value would get locked down as the default
LOCAL0 and subsequently never changed.

Since write_syslog() certainly wouldn't be called until Log_destination
is changed from its default, the triggering situation would have to be
an elog call occuring between the assignments to Log_destination and
Syslog_facility --- ie, an elog coming from guc.c itself. But that
doesn't seem out of the question at all.

The problem with this theory as an explanation for Han's report is that
he says only "some" events are reported to LOCAL0. Under this theory
a postmaster that had gotten into this mode would *always* report to
LOCAL0, and so would all its children (at least in non-EXEC_BACKEND
builds, which is to say any non-Windows build). Han, can you quantify
"some" any better?

> Log lines look like:
> Oct 14 08:55:02 pavenlo root palga [local] SELECT: [17-1] LOG: duration: \
> 2953.658 ms statement: select rapnaam from udps where ((geboortedatum = \
> '1954-01-21') and (naamman ~ '^thie'))
> Oct 14 08:55:02 pavenlo root palga [local] SELECT: [17-2] limit 1000

Another strange thing here is that the funny log entries don't show the
PID of the originating process. Since we *always* call openlog() with
the LOG_PID flag bit, this should be impossible.

> +preload_libraries =
> '/usr/prod/postgres/rubriek:rub_initialize,/usr/prod/postgres/drap,/usr/prod/postgres/naam'

Han, what are these libraries? Is it possible that any of them are
issuing openlog() calls?

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Martin Pitt 2005-10-14 17:13:35 Re: BUG #1963: SSL certificate permission check is too strict
Previous Message han.holl 2005-10-14 16:44:54 Re: Postgres logs to syslog LOCAL0

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Sullivan 2005-10-14 17:06:27 Re: On "multi-master"
Previous Message han.holl 2005-10-14 16:44:54 Re: Postgres logs to syslog LOCAL0