Add logging

This commit is contained in:
George Lacey 2022-10-05 16:28:46 +01:00
parent c81e018d97
commit 53568e360f

View File

@ -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