journald logs since last service restart.

2020-10-30 − 🏷 devops 🏷 unix 🏷 systemd

While debugging services I often want to see the systemd service log since last restart. Unfortunately doing this isn’t obvious, but there is a way.

$ journalctl _SYSTEMD_INVOCATION_ID=$(systemctl show --value -p InvocationID docker-hass)

where docker-hass is your service. I should probably add an alias for this to my dotfiles.