settings: Add a console logger.
This commit is contained in:
parent
ff6da2e15e
commit
146377454d
1 changed files with 9 additions and 3 deletions
|
@ -237,9 +237,7 @@ INSTALLED_APPS = [
|
||||||
'email_log',
|
'email_log',
|
||||||
]
|
]
|
||||||
|
|
||||||
# A sample logging configuration. The only tangible logging
|
# A sample logging configuration.
|
||||||
# performed by this configuration is to send an email to
|
|
||||||
# the site admins on every HTTP 500 error when DEBUG=False.
|
|
||||||
# See http://docs.djangoproject.com/en/dev/topics/logging for
|
# See http://docs.djangoproject.com/en/dev/topics/logging for
|
||||||
# more details on how to customize your logging configuration.
|
# more details on how to customize your logging configuration.
|
||||||
LOGGING = {
|
LOGGING = {
|
||||||
|
@ -251,6 +249,10 @@ LOGGING = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"handlers": {
|
"handlers": {
|
||||||
|
'console': {
|
||||||
|
'level': os.environ.get('DJANGO_LOG_LEVEL', 'WARNING'),
|
||||||
|
'class': 'logging.StreamHandler',
|
||||||
|
},
|
||||||
"mail_admins": {
|
"mail_admins": {
|
||||||
"level": "ERROR",
|
"level": "ERROR",
|
||||||
"filters": ["require_debug_false"],
|
"filters": ["require_debug_false"],
|
||||||
|
@ -258,6 +260,10 @@ LOGGING = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"loggers": {
|
"loggers": {
|
||||||
|
'django': {
|
||||||
|
'handlers': ['console'],
|
||||||
|
'propagate': True,
|
||||||
|
},
|
||||||
"django.request": {
|
"django.request": {
|
||||||
"handlers": ["mail_admins"],
|
"handlers": ["mail_admins"],
|
||||||
"level": "ERROR",
|
"level": "ERROR",
|
||||||
|
|
Loading…
Reference in a new issue