Use UWSGI_LOGTO environment var to set logging path

This commit is contained in:
Abhilash Raj
2017-05-20 11:01:15 -07:00
committed by Abhilash Raj
parent f88e8fc87c
commit 5503fbf79d
2 changed files with 9 additions and 10 deletions

View File

@@ -35,4 +35,4 @@ EXPOSE 8000
ENTRYPOINT ["/opt/run.sh"] ENTRYPOINT ["/opt/run.sh"]
CMD ["uwsgi", "--http-auto-chunked --http-keepalive --logto $UWSGI_LOG_URL"] CMD ["uwsgi", "--http-auto-chunked","--http-keepalive"]

View File

@@ -88,15 +88,14 @@ python manage.py collectstatic --noinput
# this command will upgrade the database. # this command will upgrade the database.
python manage.py migrate 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 # Log to the default location /opt/mailman-web-data/logs/uwsgi.log if the
# to /opt/mailman-web/logs/uwsgi.log # logging variable is not set.
# It can also point to a logging daemon accessible at a URL. if [[ ! -v UWSGI_LOGTO ]]; then
if [[ ! -v UWSGI_LOG_URL ]]; then echo "No UWSGI_LOGTO defined, logging uwsgi to /opt/mailman-web-data/logs/uwsgi.log ..."
echo "No UWSGI_LOG_URL defined, logging uwsgi to /opt/mailman-web-data/logs/uwsgi.log ..." export UWSGI_LOGTO='/opt/mailman-web-data/logs/uwsgi.log'
export UWSGI_LOG_URL='/opt/mailman-web-data/logs/uwsgi.log' if [[ ! -e "$UWSGI_LOGTO" ]]; then
if [[ ! -e "$UWSGI_LOG_URL" ]]; then touch "$UWSGI_LOGTO"
touch "$UWSGI_LOG_URL"
fi fi
fi fi