Optimizing Docker Log Output Detection (#2014)

* Optimize script logs

* Optimizing Docker Log Output Detection

* Optimizing Docker Log Output Detection
pull/2006/head
skiffer-git 9 months ago committed by GitHub
parent 13d0883507
commit 38f685bd01
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -26,6 +26,11 @@
OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
source "${OPENIM_ROOT}/scripts/install/common.sh"
if grep -q docker /proc/1/cgroup; then
exec > ${DOCKER_LOG_FILE} 2>&1
fi
OPENIM_VERBOSE=4
openim::log::info "\n# Begin to check all openim service"

@ -23,15 +23,7 @@
OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
source "${OPENIM_ROOT}/scripts/install/common.sh"
openim::log::info "\n# Use Docker to start all openim service"
trap 'openim::util::onCtrlC' INT
"${OPENIM_ROOT}"/scripts/start-all.sh
sleep 5
"${OPENIM_ROOT}"/scripts/check-all.sh
tail -f ${LOG_FILE}
tail -f ${DOCKER_LOG_FILE}

@ -36,6 +36,12 @@ if [[ ! -d "${OPENIM_OUTPUT}/logs" ]]; then
touch "$TMP_LOG_FILE"
fi
if [[ ! -f "$DOCKER_LOG_FILE" ]]; then
touch "$DOCKER_LOG_FILE"
fi
# Define the logging function
function echo_log() {
if $ENABLE_LOGGING; then

@ -17,12 +17,17 @@
#FIXME The full names of the shell scripts that need to be started are placed in the `need_to_start_server_shell` array.
#!/bin/bash
OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
source "${OPENIM_ROOT}/scripts/install/common.sh"
# Function to execute the scripts.
function execute_start_scripts() {
for script_path in "${OPENIM_SERVER_SCRIPT_START_LIST[@]}"; do
@ -57,6 +62,9 @@ function execute_start_scripts() {
if grep -q docker /proc/1/cgroup; then
exec > ${DOCKER_LOG_FILE} 2>&1
fi

Loading…
Cancel
Save