Working with Redis queues

QueueHandler and QueueListener classes are provided to facilitate interfacing with Redis.

class logutils.redis.RedisQueueHandler(key='python.logging', redis=None, limit=0)

A QueueHandler implementation which pushes pickled records to a Redis queue using a specified key.

Parameters:
  • key – The key to use for the queue. Defaults to “python.logging”.
  • redis – If specified, this instance is used to communicate with a Redis instance.
  • limit – If specified, the queue is restricted to have only this many elements.
class logutils.redis.RedisQueueListener(*handlers, **kwargs)

A QueueListener implementation which fetches pickled records from a Redis queue using a specified key.

Parameters:
  • key – The key to use for the queue. Defaults to “python.logging”.
  • redis – If specified, this instance is used to communicate with a Redis instance.
dequeue(block)

Dequeue and return a record.