mirror of
https://github.com/frappe/gunicorn.git
synced 2026-07-02 10:41:30 +08:00
chore(logging): enrich request handling log line with request method
This commit is contained in:
parent
2d4310116d
commit
aa29987be5
@ -257,7 +257,9 @@ class Worker:
|
|||||||
msg = "Invalid request from ip={ip}: {error}"
|
msg = "Invalid request from ip={ip}: {error}"
|
||||||
self.log.warning(msg.format(ip=addr[0], error=str(exc)))
|
self.log.warning(msg.format(ip=addr[0], error=str(exc)))
|
||||||
else:
|
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)
|
self.log.exception("Error handling request %s", req.uri)
|
||||||
else:
|
else:
|
||||||
self.log.exception("Error handling request (no URI read)")
|
self.log.exception("Error handling request (no URI read)")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user