Created
July 30, 2011 18:19
-
-
Save droot/1115820 to your computer and use it in GitHub Desktop.
Redis Log Handler Use
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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