!1529 修复log_destination某些设置下启动失败的问题

Merge pull request !1529 from 胡正超/pglog
This commit is contained in:
opengauss-bot 2022-02-25 01:49:37 +00:00 committed by Gitee
commit b58517ed45
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 3 additions and 2 deletions

View File

@ -3091,8 +3091,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);
}