Package ganeti :: Package utils :: Module log :: Class _ReopenableLogHandler
[hide private]
[frames] | no frames]

Class _ReopenableLogHandler

source code


Log handler with ability to reopen log file on request.

In combination with a SIGHUP handler this class can reopen the log file on user request.

Instance Methods [hide private]
 
__init__(self, filename)
Initializes this class.
source code
 
shouldRollover(self, _)
Determine whether log file should be reopened.
source code
 
doRollover(self)
Reopens the log file.
source code
 
RequestReopen(self)
Register a request to reopen the file.
source code

Inherited from logging.handlers.BaseRotatingHandler: emit

Inherited from logging.FileHandler: close

Inherited from logging.FileHandler (private): _open

Inherited from logging.StreamHandler: flush

Inherited from logging.Handler: acquire, createLock, format, get_name, handle, handleError, release, setFormatter, setLevel, set_name

Inherited from logging.Filterer: addFilter, filter, removeFilter

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]

Inherited from logging.Handler: name

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, filename)
(Constructor)

source code 

Initializes this class.

Parameters:
  • filename (string) - Path to logfile
Overrides: object.__init__

RequestReopen(self)

source code 

Register a request to reopen the file.

The file will be reopened before writing the next log record.