From: Jelte Jansen Date: Tue, 22 Jan 2013 09:28:33 +0000 (+0100) Subject: [1897] Log HTTP messages through logging system X-Git-Tag: bind10-1.0.0-rc-release~76^2~1^2~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=769bbb5edb0fe537e497ebe1a9fc3dfc130a5866;p=thirdparty%2Fkea.git [1897] Log HTTP messages through logging system --- diff --git a/src/bin/stats/stats_httpd.py.in b/src/bin/stats/stats_httpd.py.in index 057b8cadc5..77361bd620 100644 --- a/src/bin/stats/stats_httpd.py.in +++ b/src/bin/stats/stats_httpd.py.in @@ -201,6 +201,14 @@ class HttpHandler(http.server.BaseHTTPRequestHandler): self.end_headers() return body + def log_message(self, format, *args): + """overrides the parent method log_message() + to use the bind10 logging framework. + """ + logger.debug(DBG_STATHTTPD_MESSAGING, STATHTTPD_HTTPLOG, + self.address_string(), + format%args) + class HttpServerError(Exception): """Exception class for HttpServer class. It is intended to be passed from the HttpServer object to the StatsHttpd object.""" diff --git a/src/bin/stats/stats_httpd_messages.mes b/src/bin/stats/stats_httpd_messages.mes index ad2e97f387..cac3ace25d 100644 --- a/src/bin/stats/stats_httpd_messages.mes +++ b/src/bin/stats/stats_httpd_messages.mes @@ -96,3 +96,9 @@ configuration is unknown. The new configuration is ignored, and an error is sent back. As possible cause is that there was an upgrade problem, and the stats-httpd version is out of sync with the rest of the system. + +% STATHTTPD_HTTPLOG %1 %2 +Debug HTTP log message. These are the messages logged by the http server +instance. For most logs, the message shows HTTP client and query +information like HTTP method, URI, and status code, but the http server +can also log other information, such as extended status reports.