1

I am trying to create an error log from my Django project. Though I only need it to display 404 & 500 errors. All others can be ignored. (Ignore the .html I need to show it on a page, and it doesn't need to be formatted) Currently all errors at least WARNING are displayed. So How could I filter all errors except 404 and 500?

LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'handlers': {
        'file': {
            'level': 'WARNING',
            'class': 'logging.FileHandler',
            'filename': os.path.join(BASE_DIR, 'logs/debug.html'),
        },
    },
    'loggers': {
        'django': {
            'handlers': ['file'],
            'level': 'INFO',
            'propagate': True,
        },
    },
}
TomRGarr
  • 63
  • 8
  • 1
    https://stackoverflow.com/questions/238081/how-do-you-log-server-errors-on-django-sites, might help you @TomRGarr – Sanket Jun 30 '17 at 09:57

0 Answers0