mirror of
https://github.com/frappe/gunicorn.git
synced 2026-07-08 05:31:29 +08:00
Merge pull request #3514 from lukqw/enrich-error-logging
chore(logging): enrich request handling log line with request method
This commit is contained in:
commit
2cc38503b7
@ -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