logging.handlers.QueueHandler

class logging.handlers.QueueHandler(queue)

Returns a new instance of the QueueHandler class. The instance is initialized with the queue to send messages to. The queue can be any queue- like object; it’s used as-is by the enqueue() method, which needs to know how to send messages to it.

emit(record)

Enqueues the result of preparing the LogRecord.

prepare(record)

Prepares a record for queuing. The object returned by this method is enqueued.

The base implementation formats the record to merge the message and arguments, and removes unpickleable items from the record in-place.

You might want to override this method if you want to convert the record to a dict or JSON string, or send a modified copy of the record while leaving the original intact.

enqueue(record)

Enqueues the record on the queue using put_nowait(); you may want to override this if you want to use blocking behaviour, or a timeout, or a customized queue implementation.

doc_python
2016-10-07 17:36:13
Comments
Leave a Comment

Please login to continue.