logging.handlers.BufferingHandler

class logging.handlers.BufferingHandler(capacity) Initializes the handler with a buffer of the specified capacity. emit(record) Appends the record to the buffer. If shouldFlush() returns true, calls flush() to process the buffer. flush() You can override this to implement custom flushing behavior. This version just zaps the buffer to empty. shouldFlush(record) Returns true if the buffer is up to capacity. This method can be overridden to implement custom flushing strategies.

logging.handlers.BaseRotatingHandler.rotator

rotator If this attribute is set to a callable, the rotate() method delegates to this callable. The parameters passed to the callable are those passed to rotate(). New in version 3.3.

logging.handlers.BaseRotatingHandler.rotation_filename()

rotation_filename(default_name) Modify the filename of a log file when rotating. This is provided so that a custom filename can be provided. The default implementation calls the ‘namer’ attribute of the handler, if it’s callable, passing the default name to it. If the attribute isn’t callable (the default is None), the name is returned unchanged. Parameters: default_name – The default name for the log file. New in version 3.3.

logging.handlers.BaseRotatingHandler.rotate()

rotate(source, dest) When rotating, rotate the current log. The default implementation calls the ‘rotator’ attribute of the handler, if it’s callable, passing the source and dest arguments to it. If the attribute isn’t callable (the default is None), the source is simply renamed to the destination. Parameters: source – The source filename. This is normally the base filename, e.g. ‘test.log’. dest – The destination filename. This is normally what the source is rotated to, e.g. ‘test.log.1’

logging.handlers.BaseRotatingHandler.namer

namer If this attribute is set to a callable, the rotation_filename() method delegates to this callable. The parameters passed to the callable are those passed to rotation_filename(). Note The namer function is called quite a few times during rollover, so it should be as simple and as fast as possible. It should also return the same output every time for a given input, otherwise the rollover behaviour may not work as expected. New in version 3.3.

logging.handlers.BaseRotatingHandler

class logging.handlers.BaseRotatingHandler(filename, mode, encoding=None, delay=False) The parameters are as for FileHandler. The attributes are: namer If this attribute is set to a callable, the rotation_filename() method delegates to this callable. The parameters passed to the callable are those passed to rotation_filename(). Note The namer function is called quite a few times during rollover, so it should be as simple and as fast as possible. It should also return the same output ever

logging.Handler.__init__()

Handler.__init__(level=NOTSET) Initializes the Handler instance by setting its level, setting the list of filters to the empty list and creating a lock (using createLock()) for serializing access to an I/O mechanism.

logging.Handler.setLevel()

Handler.setLevel(lvl) Sets the threshold for this handler to lvl. Logging messages which are less severe than lvl will be ignored. When a handler is created, the level is set to NOTSET (which causes all messages to be processed). See Logging Levels for a list of levels. Changed in version 3.2: The lvl parameter now accepts a string representation of the level such as ‘INFO’ as an alternative to the integer constants such as INFO.

logging.Handler.setFormatter()

Handler.setFormatter(form) Sets the Formatter for this handler to form.

logging.Handler.removeFilter()

Handler.removeFilter(filt) Removes the specified filter filt from this handler.