daily pastebin goal
71%
SHARE
TWEET

Untitled

a guest Mar 13th, 2018 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import logging
  2. import os.path
  3. from logging.handlers import SysLogHandler
  4. from celery.signals import after_setup_logger, after_setup_task_logger
  5.  
  6. def after_setup_logger_handler(sender=None, logger=None, loglevel=None,
  7.                                logfile=None, format=None,
  8.                                colorize=None, **kwds):
  9.     if os.path.exists('/dev/log'):
  10.         logger.setLevel(logging.INFO)
  11.         syslog = logging.handlers.SysLogHandler(address='/dev/log')
  12.         syslog.setFormatter(logging.Formatter(format))
  13.         logger.addHandler(syslog)
  14.  
  15. after_setup_logger.connect(after_setup_logger_handler)
  16. after_setup_task_logger.connect(after_setup_logger_handler)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top