Access log file version before Home Assistant restart in Hass.io

Sometimes, HA restart due to unexpected reason or freeze.
When we restart or reboot we reset the log file so it’s hard to investigate the root causes.
Is it possible to add in the logger component an option to keep previous version of the log file.

At the very least, save one copy of the previous log as a bak file or something so with each reboot, it’s replaced with current log prior to the new one being written. This will prevent confusing old log with current, but it’s still there for anyone to check if needed. It really sucks to have home assistant (hassio) go down and only recourse is to reboot and be left with no idea about what caused the error. Serious oversight. Should hopefully be simple to implement saving last log as an option.

I haven’t looked at the SD card prior to rebooting but it’s my understanding everything is in a docker container anyway (?).

1 Like