[Django]-Which Django/Python handler class will pass logs to the UWSGI logger?

4👍

You can use the logging.StreamHandler class. For example, defining LOGGING in settings.py as follows:

LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'handlers': {
        'console': {
            'level': 'DEBUG',
            'filters': None,
            'class': 'logging.StreamHandler',
        },
    },
    'loggers': {
        'django': {
            'handlers': ['console'],
            'level': 'DEBUG',
        },
    },
}

Leave a comment