logging.handlers.SocketHandler.close()

close() Closes the socket.

logging.handlers.SocketHandler

class logging.handlers.SocketHandler(host, port) Returns a new instance of the SocketHandler class intended to communicate with a remote machine whose address is given by host and port. Changed in version 3.4: If port is specified as None, a Unix domain socket is created using the value in host - otherwise, a TCP socket is created. close() Closes the socket. emit() Pickles the record’s attribute dictionary and writes it to the socket in binary format. If there is an error with the

logging.handlers.SMTPHandler.getSubject()

getSubject(record) If you want to specify a subject line which is record-dependent, override this method.

logging.handlers.SMTPHandler.emit()

emit(record) Formats the record and sends it to the specified addressees.

logging.handlers.SMTPHandler

class logging.handlers.SMTPHandler(mailhost, fromaddr, toaddrs, subject, credentials=None, secure=None, timeout=1.0) Returns a new instance of the SMTPHandler class. The instance is initialized with the from and to addresses and subject line of the email. The toaddrs should be a list of strings. To specify a non-standard SMTP port, use the (host, port) tuple format for the mailhost argument. If you use a string, the standard SMTP port is used. If your SMTP server requires authentication, you

logging.handlers.RotatingFileHandler.emit()

emit(record) Outputs the record to the file, catering for rollover as described previously.

logging.handlers.RotatingFileHandler.doRollover()

doRollover() Does a rollover, as described above.

logging.handlers.RotatingFileHandler

class logging.handlers.RotatingFileHandler(filename, mode='a', maxBytes=0, backupCount=0, encoding=None, delay=False) Returns a new instance of the RotatingFileHandler class. The specified file is opened and used as the stream for logging. If mode is not specified, 'a' is used. If encoding is not None, it is used to open the file with that encoding. If delay is true, then file opening is deferred until the first call to emit(). By default, the file grows indefinitely. You can use the maxByte

logging.handlers.QueueListener.stop()

stop() Stops the listener. This asks the thread to terminate, and then waits for it to do so. Note that if you don’t call this before your application exits, there may be some records still left on the queue, which won’t be processed.

logging.handlers.QueueListener.start()

start() Starts the listener. This starts up a background thread to monitor the queue for LogRecords to process.