From a390b766d4b4dd99bc10a40869d670d717db8d92 Mon Sep 17 00:00:00 2001 From: yiguolei <676222867@qq.com> Date: Mon, 14 Feb 2022 09:30:12 +0800 Subject: [PATCH] [Improvement] BE could print log foreground when not use daemon mode (#8031) --- be/src/common/logconfig.cpp | 4 ++++ bin/start_be.sh | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/be/src/common/logconfig.cpp b/be/src/common/logconfig.cpp index cb2d748e48..2264f673f5 100644 --- a/be/src/common/logconfig.cpp +++ b/be/src/common/logconfig.cpp @@ -54,6 +54,10 @@ bool init_glog(const char* basename, bool install_signal_handler) { return true; } + if (getenv("DORIS_LOG_TO_STDERR") != nullptr) { + FLAGS_alsologtostderr = true; + } + if (install_signal_handler) { google::InstallFailureSignalHandler(); } diff --git a/bin/start_be.sh b/bin/start_be.sh index c29da577ba..7981c56938 100755 --- a/bin/start_be.sh +++ b/bin/start_be.sh @@ -116,5 +116,6 @@ fi if [ ${RUN_DAEMON} -eq 1 ]; then nohup $LIMIT ${DORIS_HOME}/lib/palo_be "$@" >> $LOG_DIR/be.out 2>&1 < /dev/null & else - $LIMIT ${DORIS_HOME}/lib/palo_be "$@" >> $LOG_DIR/be.out 2>&1 < /dev/null + export DORIS_LOG_TO_STDERR=1 + $LIMIT ${DORIS_HOME}/lib/palo_be "$@" 2>&1 < /dev/null fi