Skip to content

Instantly share code, notes, and snippets.

@droot
Created July 30, 2011 18:19
Show Gist options
  • Save droot/1115820 to your computer and use it in GitHub Desktop.
Save droot/1115820 to your computer and use it in GitHub Desktop.
Redis Log Handler Use
log = logging.getLogger('')
rh = RedisLogHandler() #you can specify all redis params here
rh.setLevel(logging.WARNING) #set the filter for critical logs only
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') #custom formatter
rh.setFormatter(formatter)
log.addHandler(rh)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment