chore(logging): enrich request handling log line with request method

This commit is contained in:
lukqw 2026-02-18 10:12:14 +01:00
parent 2d4310116d
commit aa29987be5

View File

@ -257,7 +257,9 @@ class Worker:
msg = "Invalid request from ip={ip}: {error}"
self.log.warning(msg.format(ip=addr[0], error=str(exc)))
else:
if hasattr(req, "uri"):
if hasattr(req, "uri") and hasattr(req, "method"):
self.log.exception("Error handling request %s %s", req.method, req.uri)
elif hasattr(req, "uri"):
self.log.exception("Error handling request %s", req.uri)
else:
self.log.exception("Error handling request (no URI read)")