summary refs log tree commit diff
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2020-10-07 11:13:38 -0400
committerGitHub <noreply@github.com>2020-10-07 11:13:38 -0400
commit8dbf62fada36f11a915cea4b6445f716e931dea3 (patch)
tree1ba01c2ae6dbfc3b9bd64b615885349b3c333bc8
parentReduce serialization errors in MultiWriterIdGen (#8456) (diff)
downloadsynapse-8dbf62fada36f11a915cea4b6445f716e931dea3.tar.xz
Include the configured log level in phone home stats. (#8477)
By reporting the log level of the synapse logger as a string.
-rw-r--r--changelog.d/8477.misc1
-rw-r--r--synapse/app/phone_stats_home.py7
2 files changed, 8 insertions, 0 deletions
diff --git a/changelog.d/8477.misc b/changelog.d/8477.misc
new file mode 100644
index 0000000000..2ee1606b6e
--- /dev/null
+++ b/changelog.d/8477.misc
@@ -0,0 +1 @@
+Include the log level in the phone home stats.
diff --git a/synapse/app/phone_stats_home.py b/synapse/app/phone_stats_home.py
index 2c8e14a8c0..daed8ccfe9 100644
--- a/synapse/app/phone_stats_home.py
+++ b/synapse/app/phone_stats_home.py
@@ -113,6 +113,13 @@ async def phone_stats_home(hs, stats, stats_process=_stats_process):
     stats["database_engine"] = hs.get_datastore().db_pool.engine.module.__name__
     stats["database_server_version"] = hs.get_datastore().db_pool.engine.server_version
 
+    #
+    # Logging configuration
+    #
+    synapse_logger = logging.getLogger("synapse")
+    log_level = synapse_logger.getEffectiveLevel()
+    stats["log_level"] = logging.getLevelName(log_level)
+
     logger.info("Reporting stats to %s: %s" % (hs.config.report_stats_endpoint, stats))
     try:
         await hs.get_proxied_http_client().put_json(