I want to log iOS application events on a remote server.
When the server is accessible from the device, I call the API call to the server. When the device is disconnected, I add the log to a text file.
In each run, I plan to check server availability, and if it is reached, the background thread starts, which rotates the log file, downloads the old log file using the POST request to the server, and deletes the old log file from the device. It's good?
However, if there are long intervals between connection availability, then theoretically the offline log file can become really large and difficult to download.
What are the alternatives to ensure that the logs (both from online and offline) end up reaching the remote server?
source share