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

Remove some superfluous logging #3855

Merged
merged 3 commits into from
Sep 13, 2018
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
2 changes: 1 addition & 1 deletion .circleci/merge_base_branch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e

# CircleCI doesn't give CIRCLE_PR_NUMBER in the environment for non-forked PRs. Wonderful.
# In this case, we just need to do some ~shell magic~ to strip it out of the PULL_REQUEST URL.
echo 'export CIRCLE_PR_NUMBER="${CIRCLE_PR_NUMBER:-${CIRCLE_PULL_REQUEST##*/}}"' >> "$BASH_ENV"
echo 'export CIRCLE_PR_NUMBER="${CIRCLE_PR_NUMBER:-${CIRCLE_PULL_REQUEST##*/}}"' >> $BASH_ENV
source $BASH_ENV

if [[ -z "${CIRCLE_PR_NUMBER}" ]]
Expand Down
1 change: 1 addition & 0 deletions changelog.d/3855.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Removed some excess logging messages.
10 changes: 10 additions & 0 deletions synapse/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,14 @@
""" This is a reference implementation of a Matrix home server.
"""

try:
from twisted.internet import protocol
from twisted.internet.protocol import Factory
from twisted.names.dns import DNSDatagramProtocol
protocol.Factory.noisy = False
Factory.noisy = False
DNSDatagramProtocol.noisy = False
except ImportError:
pass

__version__ = "0.33.4"
17 changes: 16 additions & 1 deletion synapse/config/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,22 @@ def sighup(signum, stack):
#
# However this may not be too much of a problem if we are just writing to a file.
observer = STDLibLogObserver()

def _log(event):

if "log_text" in event:
if event["log_text"].startswith("DNSDatagramProtocol starting on "):
return

if event["log_text"].startswith("(UDP Port "):
return

if event["log_text"].startswith("Timing out client"):
return

return observer(event)

globalLogBeginner.beginLoggingTo(
[observer],
[_log],
redirectStandardIO=not config.no_redirect_stdio,
)