From 3accc058e3f00c97b26311928f11e9b79dddff4c Mon Sep 17 00:00:00 2001 From: Stephan Porada Date: Wed, 11 Sep 2019 15:52:38 +0200 Subject: [PATCH] Correct simple loging --- Dockerfile | 2 +- app/logs/main.log | 2 -- app/logs/opaque_daemon.log | 0 app/logs/opaque_flask.log | 0 config.py | 6 +++--- docker-compose.yml | 1 + 6 files changed, 5 insertions(+), 6 deletions(-) delete mode 100644 app/logs/main.log create mode 100644 app/logs/opaque_daemon.log create mode 100644 app/logs/opaque_flask.log diff --git a/Dockerfile b/Dockerfile index 4f087961..e846ac41 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,7 @@ WORKDIR /home/opaque COPY app app -copy migrations migrations +COPY migrations migrations COPY config.py opaque.py requirements.txt ./ RUN python -m venv venv && \ venv/bin/pip install -r requirements.txt diff --git a/app/logs/main.log b/app/logs/main.log deleted file mode 100644 index 0d289055..00000000 --- a/app/logs/main.log +++ /dev/null @@ -1,2 +0,0 @@ -2019-09-11 12:48:21 - WARNING - werkzeug - _internal.py - 122 - * Debugger is active! -2019-09-11 12:48:21 - INFO - werkzeug - _internal.py - 122 - * Debugger PIN: 140-241-697 diff --git a/app/logs/opaque_daemon.log b/app/logs/opaque_daemon.log new file mode 100644 index 00000000..e69de29b diff --git a/app/logs/opaque_flask.log b/app/logs/opaque_flask.log new file mode 100644 index 00000000..e69de29b diff --git a/config.py b/config.py index 58b47cd8..691cc918 100644 --- a/config.py +++ b/config.py @@ -36,9 +36,9 @@ class DevelopmentConfig(Config): os.environ.get('POSTGRES_PASSWORD'), os.environ.get('POSTGRES_DB_NAME') ) - log_format = "%(asctime)s - %(levelname)s - %(name)s - "\ - "%(filename)s - %(lineno)d - %(message)s" - logging.basicConfig(filename='app/logs/main.log', level='WARNING', + log_format = ("%(asctime)s - %(levelname)s - %(name)s - " + "%(filename)s - %(lineno)d - %(message)s") + logging.basicConfig(filename='app/logs/opaque_flask.log', level='WARNING', format=log_format, datefmt='%Y-%m-%d %H:%M:%S', filemode='w') diff --git a/docker-compose.yml b/docker-compose.yml index 2b8bfb1c..80461668 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -32,6 +32,7 @@ services: image: gitlab.ub.uni-bielefeld.de:4567/sfb1288inf/opaque_daemon:latest volumes: - $HOME/.docker/config.json:/home/opaque_daemon/.docker/config.json + - ./app/logs/opaque_daemon.log:/home/opaque_daemon/logs/opaque_daemon.log db: deploy: placement: