Skip to main content

Redis pub/sub logging handler for python

Project description

==========================================================================================
RedisLogs - A simplified version of RedisLog that works with Flask in a more intuitive way
==========================================================================================

A logging handler for Flask that publishes log messages using Redis's pub/sub system. You can use this to store python logs into Redis. Inspired on the package: https://github.com/jedp/python-redis-log by Jed Parsons.

Installation
------------

The current stable release ::

pip install flask_redis_logs


Requirements
------------

- redis

Usage
-----

::

>>> from redislogs.handlers import RedisHandler
>>> redis_handler = RedisHandler(
>>> host=[ Redis Host ],
>>> port=[ Redis Port ],
>>> db=[ Redis DB ],
>>> log_key=[ Redis Channel ]
>>> )
>>> redis_handler.setLevel(logging.INFO)
>>> app.logger.addHandler(redis_handler)
>>> app.logger.info("Infor log")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for flask_redis_log, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size flask_redis_log-0.0.1.tar.gz (2.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page