Skip to content

Latest commit

 

History

History
37 lines (26 loc) · 1.1 KB

logging_.handlers.rst

File metadata and controls

37 lines (26 loc) · 1.1 KB

Handlers

QueueListenerHander

A simple QueueHandler subclass implementation utilizing QueueListener for configured handlers. This is helpful for detaching the logger handlers from the main threads, which reduces the risk of getting blocked, for example, when using slower handlers such as smtp, file, or socket handlers.

Example Usage

An example YAML configuration file utilizing QueueListenerHander

snippets/queue_listener_handler/logging.yaml

Just load the configuration file and start logging.

snippets/queue_listener_handler/test_logger.py

Optional Params

A queue object must be passed since the handler does not set a default queue implementation. Set maxsize: -1 to make the queue unlimited.

Module Members

logging.handlers.queue_listener_handler