Skip to content

Logs

control.observability.logs

Sapsan writes structured JSON logs to standard output (stdout). Set the log level with RUST_LOG; the default is info with separate filters for internal modules.

Manual startup

Use the path to your existing configuration. The second example enables detailed messages from the hls module.

RUST_LOG=info CONFIG_PATH=/etc/sapsan/sapsan.yaml /usr/sbin/sapsan
RUST_LOG=info,hls=trace CONFIG_PATH=/etc/sapsan/sapsan.yaml /usr/sbin/sapsan

systemd service

When the package runs as sapsan.service, systemd journal receives its output. Read this journal with journalctl. A separate syslog file depends on the operating system journal forwarding configuration.

sudo journalctl -u sapsan.service -n 100 --no-pager
sudo journalctl -u sapsan.service -f
sudo journalctl -u sapsan.service --since "1 hour ago" -o cat

The first two commands show recent messages and follow new messages. To change the service log level, run sudo systemctl edit sapsan and add:

[Service]
Environment="RUST_LOG=info,hls=debug"

Apply the change with sudo systemctl restart sapsan. See the journalctl documentation for filtering options.

Docker and central storage

For a container named sapsan, use:

docker logs --tail 100 sapsan
docker logs --follow sapsan

Docker receives the process stdout; viewing logs depends on the selected logging driver. To send logs to central storage, configure the Vector Docker logs source and Loki sink. Another option for Loki is Grafana Alloy with loki.source.docker. Configure the storage address and retention in your log collection system.