probator.log

class probator.log.DBLogger(min_level)

Bases: logging.Handler

Class handling logging to a MySQL database

emit(record)

Persist a record into the database

Parameters:record (logging.Record) – The logging.Record object to store
Returns:None
class probator.log.SyslogPipelineHandler(address=None, facility='local7', socktype=None)

Bases: logging.handlers.SysLogHandler

Send logs to a syslog server

class probator.log.LogLevelFilter(name='')

Bases: logging.Filter

Simply logging.Filter class to exclude certain log levels from the database logging tables

filter(record)

Determine if the specified record is to be logged.

Is the specified record to be logged? Returns 0 for no, nonzero for yes. If deemed appropriate, the record may be modified in-place.

probator.log.setup_logging()

Utility function to setup the logging systems based on the logging.json configuration file

probator.log.auditlog(*, event, actor, data, level=20)

Generate and insert a new event

Parameters:
  • event (str) – Action performed
  • actor (str) – Actor (user or subsystem) triggering the event
  • data (dict) – Any extra data necessary for describing the event
  • level (str or int) – Log level for the message. Uses standard python logging level names / numbers
Returns:

None