From 7d1775354e14a4a514b156d64f5b658920ada775 Mon Sep 17 00:00:00 2001 From: Ferry Boender Date: Mon, 25 May 2015 12:22:45 +0200 Subject: [PATCH] Log HTTP requests to the log file instead of console. --- src/scriptform.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/scriptform.py b/src/scriptform.py index a95e848..65bfe98 100755 --- a/src/scriptform.py +++ b/src/scriptform.py @@ -570,6 +570,11 @@ class WebAppHandler(BaseHTTPRequestHandler): requests. If no path is set, it dispatches to the 'index' or 'default' method. """ + def log_message(self, format, *args): + """Overrides BaseHTTPRequestHandler which logs to the console. We log + to our log file instead""" + self.scriptform.log.info("%s %s" % (self.address_string(), format%args)) + def do_GET(self): self._call(*self._parse(self.path))