heroku-django-template icon indicating copy to clipboard operation
heroku-django-template copied to clipboard

Feature request: Add sample LOGGING

Open shangxiao opened this issue 8 years ago • 3 comments

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

shangxiao avatar Aug 16 '17 01:08 shangxiao

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 avatar Aug 16 '17 06:08 akshaybabloo

@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/

shangxiao avatar Aug 16 '17 06:08 shangxiao

This seems like a good idea!

kennethreitz avatar Aug 16 '17 14:08 kennethreitz