Access host logs from prior reboot

Using HA OS (currently 12.4) I noticed the former journalctl -b 1 (according to e. g. How to get to your log after restart/restore) does not work anymore, as there seems to be no journalctl anymore according to -sh: journalctl: not found (?)

ha host logs also doesn’t provide a proper option. So:

how to access host logs from before the last reboot?

Journalctl is still there, but not available from the terminal addon. You can connect to the OS to use it, either using a connected screen, or configuring port 22222 for ssh (there’s an addon to simplify this), or for example (if you’ve installed under it) the proxmox console.

But I also copy the home-assistant.log file to .0 (thru .4) when HA restarts to make previous ones easily available from Visual Studio.

Wait - something has definitely changed here in HA OS, right?

→ No, it seems like I mixed things up in my memory. Following How to get to your log after restart/restore - #10 by CentralCommand it seems like it never was available directly. Unfortunately,

  • neither using ha host logs --identifier homeasisstant --boot -1 gives anything
  • nor copying /var/log/journal/xxxxxxxxx/yyyyyyyy.journal to a Debian based machine and jusing journalctl /path/to/copied/yyyyyyyy.journal gives anything but -- Journal begins at Sat 2024-06-08 14:17:11 CEST, ends at Thu 2024-08-15 16:42:12 CEST. -- -- No entries --
    …which is crazy as that journal file has 19.5 MB of size so there definitely should be something in there.
  • and ha host logs -b-1 -n1000 only gives Logs only contain 1 boots.

But basically, using ha host logs -b-1 -n1000 should be the way to go when searching for older host logs. So while this is still not satisfying in this specific case (summary: I don’t have those host logs from before last boot), I’ll mark this as solution.

Because I’m still using the very same SSH addon (the advanced SSH addon, formerly “community” branded SSH addon) with protection mode turned off.

…and I’m not interested in the home-assistant.log file at all, I’m looking for the host logs :wink: