gavo.protocols.gavolog module

Helper code for logging to files.

All logs that could be used both interactively and from the web server but have group ownership gavo and mode (at least) 664. Only then can both parties write logs.

The RotatingFileHandler in this module tries to ensure this.

class gavo.protocols.gavolog.RotatingFileHandler(*args, **kwargs)[source]

Bases: RotatingFileHandler

logging.handler.RotatingFile with forced group support.

doRollover()[source]

Do a rollover, as described in __init__().

gavo.protocols.gavolog.getLoggingHandler(destName, purpose, maxBytes=500000, backupCount=3, mode=436)[source]

returns a RotatingFileHandler for logging writing to destName.

If destName is not writable, then a plain StreamLogger is returned.