Make system log persistant?

I have a problem with my PI4 installation, that is crashes and becomes unresponsive every other day.
I am running the system from USB stick, but I get same same result when running from a SD-card.
No response on SSH, and the samba share goes down and it does not respond to ping. No activity on the green led, only red led is on. Only way to get the system back online is to disconnect power.

I am running latest verion of everything. No beta.

Since the system log wipes every time I reboot with a power cycle, I have no way of reading the logs to see what happend. Is there a way to make the system log survive a power cycle?

Put the SD card in a Linux PC (or a Windows PC running DiskInternals Linux Reader) and read the log file before rebooting.

Ok, is the system is purging the log on reboot? It is not in RAM? Which file are the Supervisor-, Core- and Host-log stored in?

Yes cleared on boot. Written to file not RAM. Not sure what directories, you will have to search. There may be some info on the forum.

Hmm… it crashed again. The only files I found was on HASSOS data partition, there I found a folder called logs, but they contained .journal files, and they seem to be binary. “Are these the files I am looking for?” : )

No, you are looking for .log files.

Ok thanks, found one log-file. “home assistant.log”, seems to only contain the “Core” log. Any way of finding the Supervisor and Host log aswell?

I’m not sure. You could ask on Discord.

Anything relevant in the homeassistant log?

I dont think so:

There are a massive amount of these.

2021-03-10 10:14:51 ERROR (SyncWorker_3) [hikvision.api] There was an error connecting to http://192.168.10.154/MotionDetection/1/
2021-03-10 10:14:51 ERROR (SyncWorker_3) [hikvision.api] status_code 404

The HikVision thinks my cameras have a motion sensor, but they dont. I dont this is the problem? Its only a 404?

I have this one that I cant understant if its serious fault or not:

2021-03-10 02:00:19 WARNING (Thread-26) [homeconnect.sseclient] Exception while reading event: 
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/urllib3/response.py", line 438, in _error_catcher
    yield
  File "/usr/local/lib/python3.8/site-packages/urllib3/response.py", line 764, in read_chunked
    self._update_chunk_length()
  File "/usr/local/lib/python3.8/site-packages/urllib3/response.py", line 694, in _update_chunk_length
    line = self._fp.fp.readline()
  File "/usr/local/lib/python3.8/socket.py", line 669, in readinto
    return self._sock.recv_into(b)
  File "/usr/local/lib/python3.8/ssl.py", line 1241, in recv_into
    return self.read(nbytes, buffer)
  File "/usr/local/lib/python3.8/ssl.py", line 1099, in read
    return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/requests/models.py", line 753, in generate
    for chunk in self.raw.stream(chunk_size, decode_content=True):
  File "/usr/local/lib/python3.8/site-packages/urllib3/response.py", line 572, in stream
    for line in self.read_chunked(amt, decode_content=decode_content):
  File "/usr/local/lib/python3.8/site-packages/urllib3/response.py", line 793, in read_chunked
    self._original_response.close()
  File "/usr/local/lib/python3.8/contextlib.py", line 131, in __exit__
    self.gen.throw(type, value, traceback)
  File "/usr/local/lib/python3.8/site-packages/urllib3/response.py", line 443, in _error_catcher
    raise ReadTimeoutError(self._pool, None, "Read timed out.")
urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='api.home-connect.com', port=443): Read timed out.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/homeconnect/sseclient.py", line 81, in __next__
    next_chunk = next(self.resp_iterator)
  File "/usr/local/lib/python3.8/site-packages/requests/models.py", line 760, in generate
    raise ConnectionError(e)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.home-connect.com', port=443): Read timed out.

Lots of network timeouts. Could be a symptom rather than a cause.

There’s some information on the other log locations here:

Looks like it is those journal files.