root/wsgi: log requests with event name of request

This commit is contained in:
Jens Langhammer 2020-02-16 14:36:31 +01:00
parent 447e81d0b8
commit 5dfa141e35
2 changed files with 3 additions and 2 deletions

View File

@ -7,4 +7,4 @@ threads = 2
enable-threads = true
uid = passbook
gid = passbook
disable-logging=True
disable-logging = True

View File

@ -62,7 +62,8 @@ class WSGILogger:
if environ.get("QUERY_STRING") != "":
query_string = f"?{environ.get('QUERY_STRING')}"
self.logger.info(
f"{environ.get('PATH_INFO', '')}{query_string}",
"request",
path=f"{environ.get('PATH_INFO', '')}{query_string}",
host=host,
method=environ.get("REQUEST_METHOD", ""),
protocol=environ.get("SERVER_PROTOCOL", ""),