Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

A log handler for the Python logging module, emitting all logs to specific Redis channels

Project description

redis-log-handler

Handler for the std logging module which puts logs through to Redis.

How to use

Each handler needs a channel name, and where needed a specified port, password or host.
Handlers open a connection to a channel, so they need to be closed after use or the channel will continue to exist.

Logging can be configured globally:

    log_handler = RedisLogHandler('ch:channel')
    logging.basicConfig(handlers=(log_handler,), level=logging.INFO)
    logging.info('Test-message on channel.')

    log_handler.close()

Or as a specific standalone logger:

    log_handler = RedisLogHandler('ch:channel')
    logger = logging.getLogger('name')
    logger.addHandler(log_handler)
    logger.setLevel('WARNING')

    logger.warning('Warning message')

    log_handler.close()

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 redis-log-handler, version 0.0.1.dev25
Filename, size File type Python version Upload date Hashes
Filename, size redis_log_handler-0.0.1.dev25-py2.py3-none-any.whl (4.2 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size redis-log-handler-0.0.1.dev25.tar.gz (6.3 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