From cd5f02b6963b31f852f857e68b2377c24dffefa5 Mon Sep 17 00:00:00 2001 From: gentle_hu Date: Tue, 22 Feb 2022 22:11:20 +0800 Subject: [PATCH] fix core about log_destination --- src/common/backend/utils/error/elog.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/common/backend/utils/error/elog.cpp b/src/common/backend/utils/error/elog.cpp index cea46c2c1..7a5cbb1c1 100644 --- a/src/common/backend/utils/error/elog.cpp +++ b/src/common/backend/utils/error/elog.cpp @@ -3119,8 +3119,9 @@ static void send_message_to_server_log(ErrorData* edata) } /* If in the syslogger process, try to write messages direct to file */ - FILE* logfile = LOG_DESTINATION_CSVLOG ? t_thrd.logger.csvlogFile : t_thrd.logger.syslogFile; - if (t_thrd.role == SYSLOGGER && logfile != NULL) { + if (t_thrd.role == SYSLOGGER && + t_thrd.log_cxt.Log_destination & LOG_DESTINATION_STDERR && + t_thrd.logger.syslogFile != NULL) { write_syslogger_file(buf.data, buf.len, LOG_DESTINATION_STDERR); }