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, handle, handleError, release, setFormatter, setLevel

Inherited from logging.Filterer: addFilter, filter, removeFilter

Method Details [hide private]

__init__(self, filename)
(Constructor)

source code 

Initializes this class.

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

RequestReopen(self)

source code 

Register a request to reopen the file.

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