Snippet: Syslog Config for Django 1.3

After a bunch of searching and dealing with odd errors, I finally figured out how to get syslog to play nice with Django 1.3’s new logging config. I’m posting it here for my own future reference and for anybody else who might find it useful.

from logging.handlers import SysLogHandler
LOGGING = {
    'version': 1,
    'disable_existing_loggers': True,
    'formatters': {
        'syslog': {
            'format': 'songtrust: %(levelname)s %(module)s "%(message)s"'
        },
    },
    'handlers': {
        'syslog':{ 
            'level':'DEBUG', 
            'class': 'logging.handlers.SysLogHandler', 
            'formatter': 'syslog', 
            'facility': SysLogHandler.LOG_LOCAL2,
            'address': '/dev/log',
        },
    },
    'loggers': {
        'django.request': {
            'handlers': ['syslog'],
            'level': 'DEBUG',
            'propagate': False,
        },
    },
}