andymckay/django-arecibo — Issue #7: Steal the Log Handler from funfactory
Author: davedash
Created: 2011-12-02 22:05:03+00:00
State: open

Sorry I didn't get a chance to add this to arecibo, but this should be a part of it:

paste.pocoo.org/show/515966/

import logging

class AreciboHandler(logging.Handler):
"""An exception log handler that sends tracebacks to Arecibo."""
def emit(self, record):
from django.conf import settings
arecibo = getattr(settings, 'ARECIBO_SERVER_URL', '')

if arecibo and hasattr(record, 'request'):
from django_arecibo.tasks import post
post(record.request, 500)