From 912ace9fc9b05a99256fedd9ff6a2402c4cd141a Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Fri, 7 Aug 2020 13:20:58 +0100 Subject: [PATCH 1/2] Don't log OPTIONS requests --- synapse/http/site.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/synapse/http/site.py b/synapse/http/site.py index 79a9229a264d..6e79b4782801 100644 --- a/synapse/http/site.py +++ b/synapse/http/site.py @@ -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): From 6d3868e9fb9420642ec22cb05508656cb84048ad Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Fri, 7 Aug 2020 13:27:07 +0100 Subject: [PATCH 2/2] Newsfile --- changelog.d/8049.misc | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/8049.misc diff --git a/changelog.d/8049.misc b/changelog.d/8049.misc new file mode 100644 index 000000000000..7fce36215d1b --- /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`.