Re: Feature proposal: distinguish each PostgreSQL instance in the event log

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "MauMau" <maumau307(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Feature proposal: distinguish each PostgreSQL instance in the event log
Date: 2011-03-22 14:43:31
Message-ID: 12463.1300805011@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"MauMau" <maumau307(at)gmail(dot)com> writes:
> I've encountered one problem on Windows. I need to support running all of my
> products on one host simultaneously. Plus, I need to log messages in
> syslog/event log. On Linux, I can distinguish the messages of one product
> and those of other products by setting syslog_ident in postgresql.conf. On
> the other hand, I can't do that on Windows: all of the PostgreSQL instances
> use the same fixed event source name "PostgreSQL".

> SO I'd like to propose a trivial feature which allows users to set event
> source.

I'm a bit concerned by the fact that this seems to require global
actions to be taken (registering/deregistering) when a GUC value
changes. That's going to cause headaches, not least because you cannot
assume that the value changes synchronously across all Postgres
processes. Maybe that's only an artifact of the way you worded this and
not a real requirement ... but if it is a requirement you should think
about how to avoid it. If you can't avoid it then most likely the event
name is going to have to be PGC_POSTMASTER, ie not changeable after
startup. Also, what happens if we fail to deregister because of
crashing?

> Is it better to have one parameter for syslog program name and event source,
> instead of having both syslog_ident and event_source?

I don't like aliases for GUC variables, and in any case I think it'd be
confusing to force both usages to share a name that's not particularly
appropriate for either one alone. So personally, -1 for unifying those.
Others might see it differently though.

> I would appreciate your opinions and advice. I'll try making the patch while
> I'm waiting for response. I would be very much pleased if I could contribute
> to PostgreSQL and my proposal could be included in 9.1.

As Andrew said, it's way too late for 9.1. Plenty of time to work on it
for 9.2 though.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Euler Taveira de Oliveira 2011-03-22 15:22:07 Re: When and where do PG invoke PLs module?
Previous Message MauMau 2011-03-22 14:08:42 Re: Feature proposal: distinguish each PostgreSQL instance in the event log