Skip to content

jackingod/python-redis-log

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RedisLog - A Redis Pub/Sub Logging Handler for Python

A logging handler for Python that publishes log messages using redis's pub/sub system. You can use this to read or respond to streaming log data in real time.

Installation

Git clone this repo

Or easy_install python-redis-log

Requirements

You will need:

Usage

>>> from redislog import handlers, logger
>>> l = logger.RedisLogger('my.logger')
>>> l.addHandler(handlers.RedisHandler.to("my:channel"))
>>> l.info("I like pie!")
>>> l.error("Oh snap", exc_info=True)

Redis clients subscribed to my:channel will get a json log record.

If an exception is raised, and exc_info is True, the log will include a formatted traceback.

Serving Suggestion

I recommend using this in conjunction with Andrei Savu's MongoDB logging handler, or at least some handler that will actually save your data somewhere.

About

A Python logging handler that publishes to redis pub/sub channels

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published