aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/error/elog.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/utils/error/elog.c')
-rw-r--r--src/backend/utils/error/elog.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c
index 49771ae349a..f835b21ef9c 100644
--- a/src/backend/utils/error/elog.c
+++ b/src/backend/utils/error/elog.c
@@ -42,7 +42,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.178.2.2 2007/06/14 01:49:39 adunstan Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.178.2.3 2007/07/19 19:14:25 adunstan Exp $
*
*-------------------------------------------------------------------------
*/
@@ -76,7 +76,7 @@ ErrorContextCallback *error_context_stack = NULL;
sigjmp_buf *PG_exception_stack = NULL;
-extern pid_t SysLoggerPID;
+extern bool redirection_done;
/* GUC parameters */
PGErrorVerbosity Log_error_verbosity = PGERROR_VERBOSE;
@@ -1720,11 +1720,15 @@ send_message_to_server_log(ErrorData *edata)
* 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())
+ if (pgwin32_is_service() && (!redirection_done || am_syslogger) )
write_eventlog(edata->elevel, buf.data);
else
#endif
- if (Redirect_stderr)
+ /* only use the chunking protocol if we know the syslogger should
+ * be catching stderr output, and we are not ourselves the
+ * syslogger. Otherwise, go directly to stderr.
+ */
+ if (redirection_done && !am_syslogger)
write_pipe_chunks(fileno(stderr), buf.data, buf.len);
else
write(fileno(stderr), buf.data, buf.len);