Commit 8472bdd0 authored by PCoder's avatar PCoder

Add django error logger

parent 81eee87f
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment