Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Reduce federation logging on success #7321

Merged
merged 3 commits into from
Apr 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/7321.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Reduce logging verbosity for successful federation requests.
22 changes: 14 additions & 8 deletions synapse/http/matrixfederationclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,21 +434,27 @@ def _send_request(
logger.info("Failed to send request: %s", e)
raise_from(RequestSendFailed(e, can_retry=True), e)

logger.info(
"{%s} [%s] Got response headers: %d %s",
request.txn_id,
request.destination,
response.code,
response.phrase.decode("ascii", errors="replace"),
)

incoming_responses_counter.labels(method_bytes, response.code).inc()

set_tag(tags.HTTP_STATUS_CODE, response.code)

if 200 <= response.code < 300:
logger.debug(
"{%s} [%s] Got response headers: %d %s",
request.txn_id,
request.destination,
response.code,
response.phrase.decode("ascii", errors="replace"),
)
pass
else:
logger.info(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not even sure if we need info here, but let's see how it looks.

"{%s} [%s] Got response headers: %d %s",
request.txn_id,
request.destination,
response.code,
response.phrase.decode("ascii", errors="replace"),
)
# :'(
# Update transactions table?
d = treq.content(response)
Expand Down