heroku/heroku-django-template

Feature request: Add sample LOGGING

shangxiao opened this issue · 3 comments

Might be worth considering adding a sample LOGGING config to show exceptions in the Heroku logs?

Something like

LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'formatters': {
        'verbose': {
            'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d: %(message)s'
        },
        'simple': {
            'format': '%(asctime)s [%(levelname)s] %(name)s: %(message)s'
        },
    },
    'handlers': {
        'console': {
            'level': 'INFO',
            'class': 'logging.StreamHandler',
            'formatter': 'simple'
        }
    },
    'loggers': {
        '': {
            'handlers': ['console'],
            'level': 'INFO',
            'propagate': True
        },
        'django.request': {
            'handlers': ['console'],
            'level': 'DEBUG',
            'propagate': False
        },
    }
}

I use this.

@akshaybabloo well i was thinking something simple that developers could expand on like what's listed here: https://chrxr.com/django-error-logging-configuration-heroku/

This seems like a good idea!