Implement loglevel configuration from Dockerfile

This commit is contained in:
Kristóf Tóth 2018-01-30 10:49:16 +01:00
parent 071167d3d7
commit 0e38bef92e
4 changed files with 7 additions and 3 deletions

View File

@ -62,6 +62,8 @@ ENV TFW_SUPERVISORD_CONF="/etc/supervisor/supervisord.conf"
ENV PYTHONPATH=${TFW_LIB_DIR}
ENV TFW_LOGLEVEL="debug"
COPY src/nginx /etc/nginx
RUN chown -R ${AVATAO_USER}: /var/log/nginx /var/lib/nginx && \
# nginx runs as a regular user, and can't write to /run

View File

@ -12,3 +12,4 @@ SUPERVISOR_HTTP_URI = 'http://localhost:{}'.format(SUPERVISOR_HTTP_PORT)
LOGIN_APP_DIR = os.getenv('TFW_LOGIN_APP_DIR')
TERMINADO_DIR = os.getenv('TFW_TERMINADO_DIR')
LOGLEVEL = os.getenv('TFW_LOGLEVEL').upper()

View File

@ -1,5 +1,6 @@
import logging
logging.getLogger().setLevel(logging.DEBUG)
from config import LOGLEVEL
# TODO: configure supervisord loglevel from here
logging.getLogger().setLevel(LOGLEVEL)

View File

@ -1,7 +1,7 @@
[supervisord]
user=user
logfile = /tmp/supervisord.log
loglevel = DEBUG
loglevel = %(ENV_TFW_LOGLEVEL)s
pidfile = /tmp/supervisord.pid
[unix_http_server]