Don't log OPTIONS request at INFO (#8049)

pull/8052/head
Erik Johnston 2020-08-07 14:53:05 +01:00 committed by GitHub
parent 4e874ed593
commit 2f9fd5ab00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

1
changelog.d/8049.misc Normal file
View File

@ -0,0 +1 @@
Log `OPTIONS` requests at `DEBUG` rather than `INFO` level to reduce amount logged at `INFO`.

View File

@ -319,7 +319,13 @@ class SynapseRequest(Request):
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):