Skip to content

Commit

Permalink
Don't log OPTIONS request at INFO (matrix-org#8049)
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston authored Aug 7, 2020
1 parent 4e874ed commit 2f9fd5a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
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

0 comments on commit 2f9fd5a

Please sign in to comment.