From 6fe4bafc2a8dcc40eff3275e35b6d2767026e782 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Sat, 3 Aug 2019 07:47:00 +0300 Subject: [PATCH] Decrease default Synapse logging level Also discussed previously in #213 (Github Pull Request). shared-secret-auth and rest-auth logging is still at `INFO` intentionally, as user login events seem more important to keep. Those modules typically don't spam as much. --- CHANGELOG.md | 15 +++++++++++++++ docs/maintenance-and-troubleshooting.md | 18 ++++++++++++++++++ roles/matrix-synapse/defaults/main.yml | 6 +++--- 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2f763c10..cfcde2de1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,18 @@ +# 2019-08-03 + +## Synapse logging level has been reduced to WARNING + +After [some discussion in our support room](https://matrix.to/#/!PukFFdIcHgtaaHZflT:devture.com/$156476852524179TBeKy:matrix.org?via=devture.com&via=matrix.org&via=librem.one), we've decided to change the default logging level for Synapse from `INFO` to `WARNING`. + +This greatly reduces the number of log messages that are being logged, leading to: + +- much less disk space dedicated to Synapse and thus, logs kept for longer +- easier to find some important `WARNING`, `ERROR` and `CRITICAL` messages, as they're not longer buried in thousands of non-important `INFO` messages + +If you'd like to track down an issue, you [can always increase the logging level as described here](./docs/maintenance-and-troubleshooting.md#increasing-synapse-logging). + + + # 2019-07-08 ## Synapse Maintenance docs and synapse-janitor support are available diff --git a/docs/maintenance-and-troubleshooting.md b/docs/maintenance-and-troubleshooting.md index bb8730aec..ff1f9e49e 100644 --- a/docs/maintenance-and-troubleshooting.md +++ b/docs/maintenance-and-troubleshooting.md @@ -16,6 +16,24 @@ You can see the logs by using journalctl. Example: sudo journalctl -fu matrix-synapse ``` + +## Increasing Synapse logging + +Because the [Synapse](https://github.com/matrix-org/synapse) Matrix server is originally very chatty when it comes to logging, we intentionally reduce its [logging level](https://docs.python.org/3/library/logging.html#logging-levels) from `INFO` to `WARNING`. + +If you'd like to debug an issue or [report a Synapse bug](https://github.com/matrix-org/synapse/issues/new/choose) to the developers, it'd be better if you temporarily increasing the logging level to `INFO` or even `DEBUG`. + +Example configuration (`inventory/host_vars/matrix.DOMAIN/vars.yml`): + +```yaml +matrix_synapse_log_level: "DEBUG" +matrix_synapse_storage_sql_log_level: "DEBUG" +matrix_synapse_root_log_level: "DEBUG" +``` + +Re-run the playbook after making these configuration changes. + + ## Postgres See the dedicated [PostgreSQL Maintenance](maintenance-postgres.md) documentation page. diff --git a/roles/matrix-synapse/defaults/main.yml b/roles/matrix-synapse/defaults/main.yml index 87d34dc34..ac3026e8d 100644 --- a/roles/matrix-synapse/defaults/main.yml +++ b/roles/matrix-synapse/defaults/main.yml @@ -77,9 +77,9 @@ matrix_synapse_tmp_directory_size_mb: "{{ matrix_synapse_max_upload_size_mb * 50 # Possible options are defined here https://docs.python.org/3/library/logging.html#logging-levels # warning: setting log level to DEBUG will make synapse log sensitive information such # as access tokens -matrix_synapse_log_level: "INFO" -matrix_synapse_storage_sql_log_level: "INFO" -matrix_synapse_root_log_level: "INFO" +matrix_synapse_log_level: "WARNING" +matrix_synapse_storage_sql_log_level: "WARNING" +matrix_synapse_root_log_level: "WARNING" # Rate limits matrix_synapse_rc_message: