From 7aaa002a0ec5a03fd0e9cae329a332d0cb495595 Mon Sep 17 00:00:00 2001 From: Emre Saglam Date: Thu, 2 Dec 2021 17:08:41 -0800 Subject: [PATCH] Added LOG_LEVEL env variable for the docker --- docker/bin/run.sh | 8 +++++++- docker/docker-compose.yml | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docker/bin/run.sh b/docker/bin/run.sh index 88fb25e..05e83fa 100755 --- a/docker/bin/run.sh +++ b/docker/bin/run.sh @@ -13,6 +13,12 @@ if [ ! -z "${APRSD_PLUGINS}" ]; then done fi +if [ -z "${LOG_LEVEL}" ] || [[ ! "${LOG_LEVEL}" =~ ^(CRITICAL|ERROR|WARNING|INFO)$ ]]; then + LOG_LEVEL="DEBUG" +fi + +echo "Log level is set to ${LOG_LEVEL}"; + # check to see if there is a config file APRSD_CONFIG="/config/aprsd.yml" if [ ! -e "$APRSD_CONFIG" ]; then @@ -20,4 +26,4 @@ if [ ! -e "$APRSD_CONFIG" ]; then aprsd sample-config > $APRSD_CONFIG fi -exec aprsd server -c $APRSD_CONFIG --loglevel DEBUG +exec aprsd server -c $APRSD_CONFIG --loglevel ${LOG_LEVEL} diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index cd25807..5d0a39f 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -9,3 +9,4 @@ services: environment: - TZ=America/New_York - APRS_PLUGINS=aprsd-slack-plugin>=1.0.2 + - LOG_LEVEL=ERROR