diff --git a/borgweb/borgweb/production.py b/borgweb/borgweb/production.py index 7939136..fe4532b 100644 --- a/borgweb/borgweb/production.py +++ b/borgweb/borgweb/production.py @@ -133,6 +133,37 @@ CACHES = { } } +LOGGING = { + "version": 1, + "disable_existing_loggers": False, + "root": {"level": "INFO", "handlers": ["file"]}, + "handlers": { + "file": { + "level": "INFO", + "class": "logging.FileHandler", + "filename": "/var/log/django/borgweb.log", + "formatter": "app", + }, + }, + "loggers": { + "django": { + "handlers": ["file"], + "level": "INFO", + "propagate": True + }, + }, + "formatters": { + "app": { + "format": ( + u"%(asctime)s [%(levelname)-8s] " + "(%(module)s.%(funcName)s) %(message)s" + ), + "datefmt": "%Y-%m-%d %H:%M:%S", + }, + }, +} + + # security SESSION_COOKIE_SECURE = True SECURE_SSL_REDIRECT = True