Index: backend/utils/error/elog.c =================================================================== RCS file: /projects/cvsroot/pgsql/src/backend/utils/error/elog.c,v retrieving revision 1.155 diff -c -r1.155 elog.c *** backend/utils/error/elog.c 31 Dec 2004 22:01:27 -0000 1.155 --- backend/utils/error/elog.c 13 Feb 2005 17:33:22 -0000 *************** *** 1630,1636 **** #endif /* WIN32 */ /* Write to stderr, if enabled */ if ((Log_destination & LOG_DESTINATION_STDERR) || whereToSendOutput == Debug) ! fprintf(stderr, "%s", buf.data); /* If in the syslogger process, try to write messages direct to file */ if (am_syslogger) --- 1630,1636 ---- #endif /* WIN32 */ /* Write to stderr, if enabled */ if ((Log_destination & LOG_DESTINATION_STDERR) || whereToSendOutput == Debug) ! write_stderr("%s", buf.data); /* If in the syslogger process, try to write messages direct to file */ if (am_syslogger) *************** *** 1966,1974 **** /* * On Win32, we print to stderr if running on a console, or write to ! * eventlog if running as a service */ ! if (pgwin32_is_service()) /* Running as a service */ { char errbuf[2048]; /* Arbitrary size? */ --- 1966,1978 ---- /* * On Win32, we print to stderr if running on a console, or write to ! * eventlog if running as a service. ! * If stderr redirection is enabled, write to stderr anyway, since it ! * will be captured into a file. A service will always start up with ! * the default of Redirect_stderr=false, so we need to capture that ! * to the eventlog. */ ! if (!Redirect_stderr && pgwin32_is_service()) /* Running as a service */ { char errbuf[2048]; /* Arbitrary size? */