How can I get the logs that appear before my system shuts down?

Problem solved.

It was actually Sway output, which were not being logged to systemd, making them inaccessible to me.

I run Sway through a wrapper script located in /usr/local/bin/ called sway-run. This method is recommended for starting Sway when using greetd (I’m using it with tuigreet. See greetd/wiki). The script itself explains how to direct Sway outputs to the journal.

# If you use systemd and want sway output to go to the journal, use this
# instead of the `exec sway $@` above:
#    
# exec systemd-cat --identifier=sway sway $@

So now I use exec systemd-cat --identifier=sway dbus-run-session sway $@ to start a session bus instance.

2 Likes