Fix logging in all modules

This commit is contained in:
Jan Tuomi
2017-09-19 19:31:43 +03:00
parent b507bc5f27
commit f534244dd8
6 changed files with 55 additions and 35 deletions
+40 -5
View File
@@ -35,6 +35,46 @@ if not IS_DOCKER:
else:
ALLOWED_HOSTS = ["*"]
# Logger level
LOGGERLEVEL = logging.DEBUG
LOGPATH = os.path.join(BASE_DIR, "logs", "debug.log")
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'verbose': {
'format': '%(levelname)s %(asctime)s %(module)s: %(message)s'
},
},
'handlers': {
'file': {
'level': 'DEBUG',
'class': 'logging.FileHandler',
'filename': LOGPATH,
'formatter': 'verbose',
},
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
'formatter': 'verbose',
},
},
'root': {
'handlers': ['file', 'console'],
'level': 'DEBUG',
'propagate': True,
},
'loggers': {
'django': {
'handlers': ['file', 'console'],
'level': 'WARNING',
'propagate': True,
},
},
}
# Application definition
@@ -187,11 +227,6 @@ ENABLE_AUTOMATIC_EMAILS = False
GOOGLE_RECAPTCHA_SITE_KEY = "YOUR-PUBLIC-KEY"
GOOGLE_RECAPTCHA_SECRET_KEY = "YOUR-PRIVATE-KEY"
# Logger level
LOGGERLEVEL = logging.ERROR
LOGPATH = "logs/debug.log"
# Internationalization
# https://docs.djangoproject.com/en/1.9/topics/i18n/