A handler class which writes logging records, in pickle format, to a datagram socket. The pickle which is sent is that of the LogRecord's attribute dictionary (__dict__), so that the receiver does not need to have the logging module installed in order to process the logging event.
To unpickle the record at the receiving end into a LogRecord, use the makeLogRecord function.
There are no implemented interfaces.
There are no attributes in this class.
Acquire the I/O thread lock.
Add the specified filter to this handler.
Closes the socket.
Acquire a thread lock for serializing access to the underlying I/O.
Try to create a socket, using an exponential backoff with a max retry time. Thanks to Robert Olson for the original patch (SF #815911) which has been slightly refactored.
Emit a record.
Pickles the record and writes it to the socket in binary format. If there is an error with the socket, silently drop the packet. If there was a problem with the socket, re-establishes the socket.
Determine if a record is loggable by consulting all the filters.
The default is to allow the record to be logged; any filter can veto this and the record is then dropped. Returns a zero value if a record is to be dropped, else non-zero.
Ensure all logging output has been flushed.
This version does nothing and is intended to be implemented by subclasses.
Format the specified record.
If a formatter is set, use it. Otherwise, use the default formatter for the module.
Conditionally emit the specified logging record.
Emission depends on filters which may have been added to the handler. Wrap the actual emission of the record with acquisition/release of the I/O thread lock. Returns whether the filter passed the record for emission.
Handle an error during logging.
An error has occurred during logging. Most likely cause - connection lost. Close the socket so that we can retry on the next event.
Pickles the record in binary format with a length prefix, and returns it ready for transmission across the socket.
The factory method of SocketHandler is here overridden to create a UDP socket (SOCK_DGRAM).
Release the I/O thread lock.
Remove the specified filter from this handler.
Send a pickled string to a socket.
This function no longer allows for partial sends which can happen when the network is busy - UDP does not guarantee delivery and can deliver packets out of sequence.
Set the formatter for this handler.
Set the logging level of this handler.
There are no known subclasses.