~kvikshaug/kvikshaug.no

d875465386c17296c53c5e34df08c8a519553b73 — Ali Kaafarani 2 years ago f942aaa
Write access log
4 files changed, 6 insertions(+), 4 deletions(-)

M .gitignore
M docker-compose.production.yml
M gunicorn.py
A logs/.gitkeep
M .gitignore => .gitignore +1 -0
@@ 5,3 5,4 @@
/.env
/assets/css/
/assets/js/
/logs/access.log

M docker-compose.production.yml => docker-compose.production.yml +1 -1
@@ 17,7 17,7 @@ services:
    build: .
    image: kvikshaug.no
    volumes:
      - ".:/app"
      - "./logs:/app/logs"
    environment:
      - ENVIRONMENT=production
      - FLASK_SKIP_DOTENV=1

M gunicorn.py => gunicorn.py +4 -3
@@ 18,11 18,12 @@ bind = "0.0.0.0:8000"
worker_class = "gevent"
workers = 1
timeout = 30
accesslog = "-"
access_log_format = '''%(t)s "%(r)s" %(s)s %(b)s %(L)s "%(f)s"'''


if _config == "production":
    preload_app = True
    accesslog = "logs/access.log"
    access_log_format = '''%(t)s %({x-forwarded-for}i)s %(u)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s" %(L)s'''
else:
    reload = True
    accesslog = "-"
    access_log_format = '''%(t)s "%(r)s" %(s)s %(b)s %(L)s'''

A logs/.gitkeep => logs/.gitkeep +0 -0