Is it possible to output LOGS to a SPIFFS file that's inside the ESP32?

I understand that I append. That’s the point, isn’t it ? If it was FILE_WRITE it would’ve overwritten what was already in the file.

No. This is the whole output. Running it multiple times, adds to the number of text ! inside the file.

Connected to the WiFi network
192.168.1.107
File Content:
text!
text!
End of file content

I’ve read that multiple times but I didn’t want to believe it.

From what I’ve understand there there is no way to redirect the debug messages to a SPIFFS File, right ? And if that’s the case, than surely there is another way of debugging an ESP.

What is the solution to debugging an ESP 32 without a Serial Monitor ? Let’s say I install this ESP somewhere where it’s inconvenient to access. How is anybody supposed to debug the ESP if it crashes out of nowhere ?

Thank you !