From 5503fbf79d46e3635c0fc5292f44acbec0894e12 Mon Sep 17 00:00:00 2001 From: Abhilash Raj Date: Sat, 20 May 2017 11:01:15 -0700 Subject: [PATCH] Use UWSGI_LOGTO environment var to set logging path --- web/Dockerfile | 2 +- web/assets/run.sh | 17 ++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/web/Dockerfile b/web/Dockerfile index 16bd22a..a6ada86 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -35,4 +35,4 @@ EXPOSE 8000 ENTRYPOINT ["/opt/run.sh"] -CMD ["uwsgi", "--http-auto-chunked --http-keepalive --logto $UWSGI_LOG_URL"] +CMD ["uwsgi", "--http-auto-chunked","--http-keepalive"] diff --git a/web/assets/run.sh b/web/assets/run.sh index 17a65c5..e766716 100755 --- a/web/assets/run.sh +++ b/web/assets/run.sh @@ -88,15 +88,14 @@ python manage.py collectstatic --noinput # this command will upgrade the database. python manage.py migrate -# Check if there is a non-standard location for logging defined. -# It can be changed by $UWSGI_LOG_URL environment variable, which if not set points -# to /opt/mailman-web/logs/uwsgi.log -# It can also point to a logging daemon accessible at a URL. -if [[ ! -v UWSGI_LOG_URL ]]; then - echo "No UWSGI_LOG_URL defined, logging uwsgi to /opt/mailman-web-data/logs/uwsgi.log ..." - export UWSGI_LOG_URL='/opt/mailman-web-data/logs/uwsgi.log' - if [[ ! -e "$UWSGI_LOG_URL" ]]; then - touch "$UWSGI_LOG_URL" + +# Log to the default location /opt/mailman-web-data/logs/uwsgi.log if the +# logging variable is not set. +if [[ ! -v UWSGI_LOGTO ]]; then + echo "No UWSGI_LOGTO defined, logging uwsgi to /opt/mailman-web-data/logs/uwsgi.log ..." + export UWSGI_LOGTO='/opt/mailman-web-data/logs/uwsgi.log' + if [[ ! -e "$UWSGI_LOGTO" ]]; then + touch "$UWSGI_LOGTO" fi fi