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..7981c5693868b4 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