Django LOGGING exception handling

Viewed 42

In my Django application I have below logging.

The class common.loghandler.kafkaloghandler is used as logging handler.

I would like to know how to handle the case where the kafkaloghandler itself produces the exception. It is part of third party application and I cannot change the code there. I would like to take care of that at my end. Due to the exception my rest of the code block did not work.

LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'handlers': {
        'file': {
            'level': 'DEBUG',
            'class': 'common.loghandler.kafkaloghandler',
            'filename': '/path/to/django/debug.log',
        },
    },
    'loggers': {
        'django': {
            'handlers': ['file'],
            'level': 'DEBUG',
            'propagate': True,
        },
    },
}
0 Answers
Related