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

Commit 8dbf62f

Browse files
authored
Include the configured log level in phone home stats. (#8477)
By reporting the log level of the synapse logger as a string.
1 parent ae5b2a7 commit 8dbf62f

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

changelog.d/8477.misc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Include the log level in the phone home stats.

synapse/app/phone_stats_home.py

+7
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,13 @@ async def phone_stats_home(hs, stats, stats_process=_stats_process):
113113
stats["database_engine"] = hs.get_datastore().db_pool.engine.module.__name__
114114
stats["database_server_version"] = hs.get_datastore().db_pool.engine.server_version
115115

116+
#
117+
# Logging configuration
118+
#
119+
synapse_logger = logging.getLogger("synapse")
120+
log_level = synapse_logger.getEffectiveLevel()
121+
stats["log_level"] = logging.getLevelName(log_level)
122+
116123
logger.info("Reporting stats to %s: %s" % (hs.config.report_stats_endpoint, stats))
117124
try:
118125
await hs.get_proxied_http_client().put_json(

0 commit comments

Comments
 (0)