Add django error logger
This commit is contained in:
parent
81eee87fb9
commit
8472bdd097
1 changed files with 23 additions and 0 deletions
|
@ -684,6 +684,17 @@ if ENABLE_LOGGING:
|
|||
}
|
||||
}
|
||||
loggers_dict.update(logger_item)
|
||||
if not 'django' in MODULES_TO_LOG:
|
||||
loggers_dict.update(
|
||||
{
|
||||
'django': {
|
||||
'handlers': ['django_error'],
|
||||
'level': 'ERROR',
|
||||
'propagate': True
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
custom_handler_item = {
|
||||
'custom_file': {
|
||||
|
@ -697,6 +708,18 @@ if ENABLE_LOGGING:
|
|||
'maxBytes': 1024 * 1024 * 5,
|
||||
'backupCount': 10,
|
||||
'formatter': 'standard',
|
||||
},
|
||||
'django_error': {
|
||||
'level': 'ERROR',
|
||||
'class': 'logging.handlers.RotatingFileHandler',
|
||||
'filename':
|
||||
"{PROJECT_DIR}/logs/django-error.log".format(
|
||||
LEVEL=LOG_LEVEL.lower(),
|
||||
PROJECT_DIR=PROJECT_DIR
|
||||
),
|
||||
'maxBytes': 1024 * 1024 * 5,
|
||||
'backupCount': 10,
|
||||
'formatter': 'standard',
|
||||
}
|
||||
}
|
||||
handlers_dict.update(custom_handler_item)
|
||||
|
|
Loading…
Reference in a new issue