Re: BUG #6011: Some extra messages are output in the event log at PostgreSQL startup

Lists: pgsql-bugs
From: "MauMau" <maumau307(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #6011: Some extra messages are output in the event log at PostgreSQL startup
Date: 2011-05-06 14:08:37
Message-ID: 201105061408.p46E8bK2003526@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 6011
Logged by: MauMau
Email address: maumau307(at)gmail(dot)com
PostgreSQL version: 8.3.12/9.0.3
Operating system: Windows XP and Vista
Description: Some extra messages are output in the event log at
PostgreSQL startup
Details:

Hello,

My software package embeds PostgreSQL as a data repository (thank you). The
PostgreSQL server is registered as a Windows service with "pg_ctl register
-w ...", and is started as a service with "pg_ctl runservice ...".

The problem is that the following messages are always output in the event
log at PostgreSQL startup, even when the log_destination parameter doesn't
contain 'eventlog':

[message 1]
Waiting for server startup...

[message 2]
Server started and accepting connections

One of my customers is very sensitive to extra unnecessary messages. They
gave me a simple and reasonable question "Why are those messages output when
event logging is disabled? Is this a bug? Is there a way to prevent these
messages?"

The expected behavior is that no message is output in the event log when
log_destination doesn't contain 'eventlog'. I wish the behavior will be
corrected in 8.3.x.


From: Magnus Hagander <magnus(at)hagander(dot)net>
To: MauMau <maumau307(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #6011: Some extra messages are output in the event log at PostgreSQL startup
Date: 2011-05-06 18:49:07
Message-ID: BANLkTim=nBAEiE-_TEia5eez-KTVurNcHw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

On Fri, May 6, 2011 at 16:08, MauMau <maumau307(at)gmail(dot)com> wrote:
>
> The following bug has been logged online:
>
> Bug reference:      6011
> Logged by:          MauMau
> Email address:      maumau307(at)gmail(dot)com
> PostgreSQL version: 8.3.12/9.0.3
> Operating system:   Windows XP and Vista
> Description:        Some extra messages are output in the event log at
> PostgreSQL startup
> Details:
>
> Hello,
>
> My software package embeds PostgreSQL as a data repository (thank you). The
> PostgreSQL server is registered as a Windows service with "pg_ctl register
> -w ...", and is started as a service with "pg_ctl runservice ...".
>
> The problem is that the following messages are always output in the event
> log at PostgreSQL startup, even when the log_destination parameter doesn't
> contain 'eventlog':
>
> [message 1]
> Waiting for server startup...
>
> [message 2]
> Server started and accepting connections
>
> One of my customers is very sensitive to extra unnecessary messages. They
> gave me a simple and reasonable question "Why are those messages output when
> event logging is disabled? Is this a bug? Is there a way to prevent these
> messages?"
>
> The expected behavior is that no message is output in the event log when
> log_destination doesn't contain 'eventlog'. I wish the behavior will be
> corrected in 8.3.x.

Any events that happen before we have opened the regular logfile will
be written to the eventlog if the server is running as a Windows
service. There is no way to turn that off (other than removing the
code and recompiling, of course). If we didn't send those to the
eventlog, they would be completely lost since there is no stderr
available to a windows service.

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: MauMau <maumau307(at)gmail(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #6011: Some extra messages are output in the event log at PostgreSQL startup
Date: 2011-05-06 19:05:12
Message-ID: 1854.1304708712@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Magnus Hagander <magnus(at)hagander(dot)net> writes:
> On Fri, May 6, 2011 at 16:08, MauMau <maumau307(at)gmail(dot)com> wrote:
>> The problem is that the following messages are always output in the event
>> log at PostgreSQL startup, even when the log_destination parameter doesn't
>> contain 'eventlog':
>>
>> [message 1]
>> Waiting for server startup...
>>
>> [message 2]
>> Server started and accepting connections
>>
>> One of my customers is very sensitive to extra unnecessary messages. They
>> gave me a simple and reasonable question "Why are those messages output when
>> event logging is disabled? Is this a bug? Is there a way to prevent these
>> messages?"

> Any events that happen before we have opened the regular logfile will
> be written to the eventlog if the server is running as a Windows
> service. There is no way to turn that off (other than removing the
> code and recompiling, of course). If we didn't send those to the
> eventlog, they would be completely lost since there is no stderr
> available to a windows service.

These particular messages appear to be coming from pg_ctl, not from the
server at all, so the server logging configuration is irrelevant anyway.

What I think *is* relevant is pg_ctl's -s (--silent) switch, which is
defined as "only print errors, no informational messages". I would
expect that to silence "waiting for ..." messages, and indeed it appears
to do so in all the cases on the Unix side of the fence. However,
someone chose to code these Windows-specific messages as direct
write_eventlog calls instead of going through print_msg, which means
that -s doesn't silence them. So possibly the OP is right that this is
a bug and not just an unimplemented feature.

regards, tom lane


From: "MauMau" <maumau307(at)gmail(dot)com>
To: "Magnus Hagander" <magnus(at)hagander(dot)net>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #6011: Some extra messages are output in the event log at PostgreSQL startup
Date: 2011-05-07 00:35:05
Message-ID: 659BD8622BB84D8684AEB57A1F8AA0C4@maumau
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

> Magnus Hagander <magnus(at)hagander(dot)net> writes:
>> Any events that happen before we have opened the regular logfile will
>> be written to the eventlog if the server is running as a Windows
>> service. There is no way to turn that off (other than removing the
>> code and recompiling, of course). If we didn't send those to the
>> eventlog, they would be completely lost since there is no stderr
>> available to a windows service.
>

From: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
> These particular messages appear to be coming from pg_ctl, not from the
> server at all, so the server logging configuration is irrelevant anyway.
>
> What I think *is* relevant is pg_ctl's -s (--silent) switch, which is
> defined as "only print errors, no informational messages". I would
> expect that to silence "waiting for ..." messages, and indeed it appears
> to do so in all the cases on the Unix side of the fence. However,
> someone chose to code these Windows-specific messages as direct
> write_eventlog calls instead of going through print_msg, which means
> that -s doesn't silence them. So possibly the OP is right that this is
> a bug and not just an unimplemented feature.

I think that those two messages in question are not very helpful, so I hope
those are omitted by default (i.e. even without pg_ctl's -s). If they are
useful and should be logged in the event log, why aren't they logged in
syslog on UNIX/Linux?

So, I wish that the direct calls to write_eventlog will be eliminated. If
those messages are useful for some reason, it may be okay that pg_ctl's -s
hides them at worst. However, it's better to remove the write_eventlog calls
in question, because those software dependent on PostgreSQL have to be
modified to add -s.

Can I expect this will be treated as a bug and fixed in 8.3.x too? BTW, how
can I check the bug treatment? I saw somewhere that you don't like issue
trackers such as JIRA or Bugzilla.

Regards,
MauMau