From 1ef6317e2052a87a7bb3f57cd4d38fb4d7263467 Mon Sep 17 00:00:00 2001 From: guoleiyi Date: Sat, 12 Feb 2022 23:40:17 +0800 Subject: [PATCH 1/3] [Improvement] BE could print log foreground when not use daemon --- 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 cb2d748e4886b2..2264f673f5d40f 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 c29da577ba52bb..d33ceed6e994ba 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 + env $LIMIT ${DORIS_HOME}/lib/palo_be "$@" >> $LOG_DIR/be.out 2>&1 < /dev/null fi From e7e447827c67b1df40e437ef5be3de3a741a7f4b Mon Sep 17 00:00:00 2001 From: guoleiyi Date: Sat, 12 Feb 2022 23:41:02 +0800 Subject: [PATCH 2/3] fix bug --- bin/start_be.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/start_be.sh b/bin/start_be.sh index d33ceed6e994ba..bcc3a921bc27cd 100755 --- a/bin/start_be.sh +++ b/bin/start_be.sh @@ -117,5 +117,5 @@ if [ ${RUN_DAEMON} -eq 1 ]; then nohup $LIMIT ${DORIS_HOME}/lib/palo_be "$@" >> $LOG_DIR/be.out 2>&1 < /dev/null & else export DORIS_LOG_TO_STDERR=1 - env $LIMIT ${DORIS_HOME}/lib/palo_be "$@" >> $LOG_DIR/be.out 2>&1 < /dev/null + env $LIMIT ${DORIS_HOME}/lib/palo_be "$@" 2>&1 < /dev/null fi From d2b1e50a6cc7abb22baaecd36989f75d36889706 Mon Sep 17 00:00:00 2001 From: yiguolei <676222867@qq.com> Date: Sun, 13 Feb 2022 10:53:48 +0800 Subject: [PATCH 3/3] Update start_be.sh --- bin/start_be.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/start_be.sh b/bin/start_be.sh index bcc3a921bc27cd..7981c5693868b4 100755 --- a/bin/start_be.sh +++ b/bin/start_be.sh @@ -117,5 +117,5 @@ if [ ${RUN_DAEMON} -eq 1 ]; then nohup $LIMIT ${DORIS_HOME}/lib/palo_be "$@" >> $LOG_DIR/be.out 2>&1 < /dev/null & else export DORIS_LOG_TO_STDERR=1 - env $LIMIT ${DORIS_HOME}/lib/palo_be "$@" 2>&1 < /dev/null + $LIMIT ${DORIS_HOME}/lib/palo_be "$@" 2>&1 < /dev/null fi