diff options
author | Erik Johnston <erik@matrix.org> | 2020-08-07 14:53:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-07 14:53:05 +0100 |
commit | 2f9fd5ab00fa915fd76e5ebcfbbe458b17d0168e (patch) | |
tree | 652c5efeda2a6a4376a0e7d3991a78dd978ae1b3 | |
parent | Remove unnecessary maybeDeferred calls (#8044) (diff) | |
download | synapse-2f9fd5ab00fa915fd76e5ebcfbbe458b17d0168e.tar.xz |
Don't log OPTIONS request at INFO (#8049)
-rw-r--r-- | changelog.d/8049.misc | 1 | ||||
-rw-r--r-- | synapse/http/site.py | 8 |
2 files changed, 8 insertions, 1 deletions
diff --git a/changelog.d/8049.misc b/changelog.d/8049.misc new file mode 100644 index 0000000000..7fce36215d --- /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 79a9229a26..6e79b47828 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): |