Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Don't log OPTIONS request at INFO #8049

Merged
merged 2 commits into from
Aug 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/8049.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Log `OPTIONS` requests at `DEBUG` rather than `INFO` level to reduce amount logged at `INFO`.
8 changes: 7 additions & 1 deletion synapse/http/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,13 @@ def _finished_processing(self):
def _should_log_request(self) -> bool:
"""Whether we should log at INFO that we processed the request.
"""
return self.path != b"/health"
if self.path == b"/health":
return False

if self.method == b"OPTIONS":
return False

return True


class XForwardedForRequest(SynapseRequest):
Expand Down