Improved some logging levels for stats

This commit is contained in:
Ciaran Gultnieks 2014-02-22 10:05:07 +00:00
parent bb16e37a24
commit 5cd47137dd

View file

@ -99,7 +99,7 @@ def main():
destsize = ftp.stat(f).st_size destsize = ftp.stat(f).st_size
if (not os.path.exists(destpath) or if (not os.path.exists(destpath) or
os.path.getsize(destpath) != destsize): os.path.getsize(destpath) != destsize):
logging.info("...retrieving " + f) logging.debug("...retrieving " + f)
ftp.get(f, destpath) ftp.get(f, destpath)
except Exception: except Exception:
traceback.print_exc() traceback.print_exc()
@ -122,7 +122,7 @@ def main():
logexpr = '(?P<ip>[.:0-9a-fA-F]+) - - \[(?P<time>.*?)\] "GET (?P<uri>.*?) HTTP/1.\d" (?P<statuscode>\d+) \d+ "(?P<referral>.*?)" "(?P<useragent>.*?)"' logexpr = '(?P<ip>[.:0-9a-fA-F]+) - - \[(?P<time>.*?)\] "GET (?P<uri>.*?) HTTP/1.\d" (?P<statuscode>\d+) \d+ "(?P<referral>.*?)" "(?P<useragent>.*?)"'
logsearch = re.compile(logexpr).search logsearch = re.compile(logexpr).search
for logfile in glob.glob(os.path.join(logsdir,'access-*.log.gz')): for logfile in glob.glob(os.path.join(logsdir,'access-*.log.gz')):
logging.info('...' + logfile) logging.debug('...' + logfile)
if options.verbose: if options.verbose:
print '...' + logfile print '...' + logfile
p = subprocess.Popen(["zcat", logfile], stdout = subprocess.PIPE) p = subprocess.Popen(["zcat", logfile], stdout = subprocess.PIPE)