Add log file configuration support
This commit is contained in:
parent
376cfab88f
commit
c7fda0e993
1 changed files with 27 additions and 2 deletions
|
@ -305,19 +305,44 @@ LOGGING = {
|
|||
},
|
||||
"filters": {"require_debug_false": {"()": "django.utils.log.RequireDebugFalse"}},
|
||||
"handlers": {
|
||||
"console": {
|
||||
"class": "logging.StreamHandler",
|
||||
},
|
||||
"logfile": {
|
||||
"level": "INFO",
|
||||
"class": "logging.FileHandler",
|
||||
"filename": get_env_variable("GVA_LOG_FILE", default="gva.log"),
|
||||
"formatter": "verbose",
|
||||
},
|
||||
"mail_admins": {
|
||||
"level": "ERROR",
|
||||
"filters": ["require_debug_false"],
|
||||
"class": "django.utils.log.AdminEmailHandler",
|
||||
}
|
||||
},
|
||||
},
|
||||
"root": {
|
||||
"handlers": ["console"],
|
||||
"level": "WARNING",
|
||||
},
|
||||
"loggers": {
|
||||
"django.request": {
|
||||
"handlers": ["mail_admins"],
|
||||
"level": "ERROR",
|
||||
"propagate": True,
|
||||
}
|
||||
},
|
||||
"django": {
|
||||
"handlers": ["logfile"],
|
||||
"level": "INFO",
|
||||
"propagate": False,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for app in LOCAL_APPS:
|
||||
LOGGING["loggers"][app] = {
|
||||
"handlers": ["logfile"],
|
||||
"level": "INFO",
|
||||
"propagate": False,
|
||||
}
|
||||
# ######### END LOGGING CONFIGURATION
|
||||
|
||||
|
|
Loading…
Reference in a new issue