From 1e299f1d6126f186bb6681e99281f1edf32d4867 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Mon, 3 Nov 2008 22:22:22 +0100 Subject: [PATCH] Added access log to load balancer. --- download/getfile.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/download/getfile.py b/download/getfile.py index b2ca448b..eb57b56d 100644 --- a/download/getfile.py +++ b/download/getfile.py @@ -8,6 +8,7 @@ import cgi from mimetypes import guess_type debug = open("debug.log", "a") #None +access = open("access.log", "a") hosts = ( # PRIO SCHEME HOSTNAME PATH @@ -125,12 +126,14 @@ while servers.all(): print "Pragma: no-cache" print + access.write("%s\n" % url) if debug: debug.write("OK %s\n" % url) break else: if os.access(file, os.R_OK): + access.write("%s\n" % url) servefile(file) else: print "Status: 404 Not Found" @@ -140,5 +143,6 @@ else: if debug: debug.write("ERR %s wasn't found on any server" % file) +access.close() if debug: debug.close() -- 2.47.3