diff --git a/changelog.d/8049.misc b/changelog.d/8049.misc new file mode 100644 index 000000000..7fce36215 --- /dev/null +++ b/changelog.d/8049.misc @@ -0,0 +1 @@ +Log `OPTIONS` requests at `DEBUG` rather than `INFO` level to reduce amount logged at `INFO`. diff --git a/synapse/http/site.py b/synapse/http/site.py index 79a9229a2..6e79b4782 100644 --- a/synapse/http/site.py +++ b/synapse/http/site.py @@ -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):