Skip to content

Instantly share code, notes, and snippets.

@tswicegood
tswicegood / celery_logging.py
Created November 1, 2011 19:34
Simple code to hook up Celery and Loggly
LOGGLY_INPUT_KEY = "your key here"
import hoover
import logging
def initialize_loggly(loglevel=logging.WARN, **kwargs):
handler = hoover.LogglyHttpHandler(token=LOGGLY_INPUT_KEY)
log = logging.getLogger('celery')
log.addHandler(handler)
log.setLevel(loglevel)