duct.logs¶
duct.logs.follower¶
- class duct.logs.follower.LogFollower(logfile, parser=None, tmp_path='/var/lib/duct/', history=False)[source]¶
Bases:
objectProvides a class for following log files between runs
- Parameters:
logfile (str) – Full path to logfile
parser (str) – Optional parser method for log lines
tmp_path (str) – Temporary path used to store position markers
history (str) – If True the log is read from the start instead of tailed unless its already been read
duct.logs.parsers¶
- class duct.logs.parsers.ApacheLogParser(fmt)[source]¶
Bases:
objectParses Apache log format
Adapted from http://code.google.com/p/apachelog
- Parameters:
format (str) – Apache log format definition eg r’%h %l %u %t “%r” %>s %b “%{Referer}i” “%{User-Agent}i”’ or one of ‘common’, ‘vhcommon’ or ‘combined’