From: | Andrew Dunstan <andrew(at)dunslane(dot)net> |
---|---|
To: | PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | elog.c logic bug? |
Date: | 2007-06-06 15:31:04 |
Message-ID: | 4666D338.1080902@dunslane.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
I have just been staring for some time at the logic in
src/backend/utils/error/elog.c:send_message_to_server_log(), which
contains this fragment near the end:
/* Write to stderr, if enabled */
if ((Log_destination & LOG_DESTINATION_STDERR) || whereToSendOutput
== DestDebug)
{
#ifdef WIN32
/*
* In a win32 service environment, there is no usable stderr.
Capture
* anything going there and write it to the eventlog instead.
*
* If stderr redirection is active, it's ok to write to stderr
because
* that's really a pipe to the syslogger process. Unless we're
in the
* postmaster, and the syslogger process isn't started yet.
*/
if ((!Redirect_stderr || am_syslogger || (!IsUnderPostmaster &&
SysLoggerPID==0)) && pgwin32_is_service())
write_eventlog(edata->elevel, buf.data);
else
#endif
fprintf(stderr, "%s", buf.data);
}
/* If in the syslogger process, try to write messages direct to file */
if (am_syslogger)
write_syslogger_file(buf.data, buf.len);
ISTM that this is a bug - the last statement should be inside the STDERR
block above, the last part of which would then read:
/* If in the syslogger process, try to write messages direct to file */
if (am_syslogger)
write_syslogger_file(buf.data, buf.len);
else
fprintf(stderr, "%s", buf.data);
If not I have missed something - why would the syslogger be trying to
write to its output (possibly for the second time) regardless of what
Log_destination is set to?
cheers
andrew
From | Date | Subject | |
---|---|---|---|
Next Message | Matthew T. O'Connor | 2007-06-06 16:17:11 | Re: [RFC] GSoC Work on readonly queries done so far |
Previous Message | Zeugswetter Andreas ADI SD | 2007-06-06 15:29:45 | Re: TOAST usage setting |