Persisting Hass.io logs through restarts?

I’m an issue currently where Hass is dying every couple of days and I’m struggling to figure out why.

The main issue is that logs don’t persist through restarts so I’ve got no way of investigating the problem! When it crashes I can’t even get onto the host Resin.io OS via SSH, so I end up power cycling the Pi. When everything comes back up I have no visibility of what went wrong :frowning: .

Does anyone have any way of persisting the logs for Hass.io? I’m considering trying to create a Splunk (or similar) add-on, but I don’t know when I’m going to find time to get something like that working. It would be awesome if someone already had a solution to this problem?

I have the same problem, longest time online was 85 hrs and no way to find out why, would be great if someone can help

If you have access to a PC that you can keep running, you could create a batch file to periodically copy the logfile at set intervals?

I could rig up my laptop like that, but it’s not really a long term solution.

I’ll have to have a look at setting up some sort of log aggregator that persists the logs to storage so they don’t get trashed between restarts.

Apologies I hadn’t realised that you were looking for a long-term solution. I assumed you just wanted to troubleshoot the issue as a 1 time thing. Perhaps a shell script to store a copy with an hourly automation?

I’m trying to do both. I dislike short term hacky solutions to a problem, especially if I’m likely to have to do it again in future.

Was this solved? I have the same issue. I need to restart the PI to get hassio back up and running again. I need an older log to figure out what is going on.

1 Like

I also need to access older logs, but cannot.

+1


EDIT: Just made a post in another thread: Hassio 0.102.1 just froze. How I can troubleshoot such issues?

It should do what you want