From ecdf370cb77553568bf708a51adf544af56859c8 Mon Sep 17 00:00:00 2001 From: Suguru Hirahara Date: Sat, 1 Feb 2025 16:19:10 +0900 Subject: [PATCH] Update docs/faq.md and docs/maintenance-and-troubleshooting.md: move the troubleshooting section from the FAQ page to the dedicated page As the theme deserves the dedicated page and we already have it, it seems sensible to move the topic from the general FAQ page. Signed-off-by: Suguru Hirahara --- docs/faq.md | 33 +------------------------ docs/maintenance-and-troubleshooting.md | 25 +++++++++++++++++-- 2 files changed, 24 insertions(+), 34 deletions(-) diff --git a/docs/faq.md b/docs/faq.md index bd537aa69..502e40b0d 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -407,40 +407,9 @@ If you're running Ansible from within a container (one of the possibilities we l ### I get "Error response from daemon: configured logging driver does not support reading" when I do `docker logs matrix-synapse`. -See [How can I see the logs?](#how-can-i-see-the-logs). - -### How can I see the logs? - -We utilize [systemd/journald](https://www.freedesktop.org/software/systemd/man/systemd-journald.service.html#Description) for logging. - -To see logs for Synapse, run `journalctl -fu matrix-synapse.service`. You may wish to see the [manual page for journalctl](https://www.commandlinux.com/man-page/man1/journalctl.1.html). - -Available service names can be seen by doing `ls /etc/systemd/system/matrix*.service` on the server. - -Some services also log to files in `/matrix/*/data/..`, but we're slowly moving away from that. - To prevent double-logging, Docker logging is disabled by explicitly passing `--log-driver=none` to all containers. Due to this, you **cannot** view logs using `docker logs matrix-*`. -We just simply delegate logging to journald and it takes care of persistence and expiring old data. - -Also see: [How long do systemd/journald logs persist for?](#how-long-do-systemdjournald-logs-persist-for) - -### How long do systemd/journald logs persist for? - -On some distros, the journald logs are just in-memory and not persisted to disk. - -Consult (and feel free to adjust) your distro's journald logging configuration in `/etc/systemd/journald.conf`. - -To enable persistence and put some limits on how large the journal log files can become, adjust your configuration like this: - -```ini -[Journal] -RuntimeMaxUse=200M -SystemMaxUse=1G -RateLimitInterval=0 -RateLimitBurst=0 -Storage=persistent -``` +See [this section](maintenance-and-troubleshooting.md#how-to-see-the-logs) on the page for maintenance and troubleshooting for more details to see the logs. ## Maintenance diff --git a/docs/maintenance-and-troubleshooting.md b/docs/maintenance-and-troubleshooting.md index e6439a3bb..377eca51a 100644 --- a/docs/maintenance-and-troubleshooting.md +++ b/docs/maintenance-and-troubleshooting.md @@ -12,15 +12,36 @@ sudo systemctl status matrix-synapse Active: active (running) since Sun 2024-01-14 09:13:06 UTC; 1h 31min ago ``` +## How to see the logs + Docker containers that the playbook configures are supervised by [systemd](https://wiki.archlinux.org/title/Systemd) and their logs are configured to go to [systemd-journald](https://wiki.archlinux.org/title/Systemd/Journal). -To view systemd-journald logs using [journalctl](https://man.archlinux.org/man/journalctl.1), log in to the server with SSH and run a command like this: +For example, you can find the logs of `matrix-synapse` in `systemd-journald` by logging in to the server with SSH and running the command as below: ```sh sudo journalctl -fu matrix-synapse ``` -**Note**: to prevent double-logging, Docker logging is disabled by explicitly passing `--log-driver=none` to all containers. Due to this, you **cannot** view logs using `docker logs matrix-*`. +Available service names can be seen by doing `ls /etc/systemd/system/matrix*.service` on the server. Some services also log to files in `/matrix/*/data/..`, but we're slowly moving away from that. + +We just simply delegate logging to journald and it takes care of persistence and expiring old data. + +### Enable systemd/journald logs persistence + +On some distros, the journald logs are just in-memory and not persisted to disk. + +Consult (and feel free to adjust) your distro's journald logging configuration in `/etc/systemd/journald.conf`. + +To enable persistence and put some limits on how large the journal log files can become, adjust your configuration like this: + +```ini +[Journal] +RuntimeMaxUse=200M +SystemMaxUse=1G +RateLimitInterval=0 +RateLimitBurst=0 +Storage=persistent +``` ## How to check if services work