mirror of
https://github.com/Kozea/Radicale.git
synced 2025-08-07 18:30:54 +00:00
extend request log with HTTPS info
This commit is contained in:
parent
9372344bb1
commit
914320826f
1 changed files with 7 additions and 2 deletions
|
@ -150,6 +150,7 @@ class Application(ApplicationPartDelete, ApplicationPartHead,
|
||||||
time_begin = datetime.datetime.now()
|
time_begin = datetime.datetime.now()
|
||||||
request_method = environ["REQUEST_METHOD"].upper()
|
request_method = environ["REQUEST_METHOD"].upper()
|
||||||
unsafe_path = environ.get("PATH_INFO", "")
|
unsafe_path = environ.get("PATH_INFO", "")
|
||||||
|
https = environ.get("HTTPS", "")
|
||||||
|
|
||||||
"""Manage a request."""
|
"""Manage a request."""
|
||||||
def response(status: int, headers: types.WSGIResponseHeaders,
|
def response(status: int, headers: types.WSGIResponseHeaders,
|
||||||
|
@ -210,9 +211,13 @@ class Application(ApplicationPartDelete, ApplicationPartHead,
|
||||||
depthinfo = ""
|
depthinfo = ""
|
||||||
if environ.get("HTTP_DEPTH"):
|
if environ.get("HTTP_DEPTH"):
|
||||||
depthinfo = " with depth %r" % environ["HTTP_DEPTH"]
|
depthinfo = " with depth %r" % environ["HTTP_DEPTH"]
|
||||||
logger.info("%s request for %r%s received from %s%s",
|
if https:
|
||||||
|
https_info = " " + environ.get("SSL_PROTOCOL", "") + " " + environ.get("SSL_CIPHER", "")
|
||||||
|
else:
|
||||||
|
https_info = ""
|
||||||
|
logger.info("%s request for %r%s received from %s%s%s",
|
||||||
request_method, unsafe_path, depthinfo,
|
request_method, unsafe_path, depthinfo,
|
||||||
remote_host, remote_useragent)
|
remote_host, remote_useragent, https_info)
|
||||||
if self._request_header_on_debug:
|
if self._request_header_on_debug:
|
||||||
logger.debug("Request header:\n%s",
|
logger.debug("Request header:\n%s",
|
||||||
pprint.pformat(self._scrub_headers(environ)))
|
pprint.pformat(self._scrub_headers(environ)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue