Article Image
Article Image
read

Logging

Logging in production is a must.

Web applications have it easy, can write them directly to disk or to a database, but for mobile and desktop applications it is a bit harder. If you simply write it to file you will be forced to somehow retrieve that file from the user if needed. That requires an action from the user that only a small percentage of them are going to do so you are guaranteed not to be notified of most things apart from the most serious ones. Another problem is that mobile OSes (yes, android too) make it not straightfoward to retrieve files from application sandboxes so you will probably need to walk your users through it.

The solution is to send a request each time you want to log something. It is not ideal and there are solutions to aggregate these multiple requests into one, but in the end you need to send the data to a server that you control.

It is something that you can do with one .php file as well as custom solutions for 100 euros a month, it depends from your needs. As a starter you can take a look at Firebase Analytics, SwiftyBeaver (iOS only) or if you prefer a self hosted solution Parse Server.

Blog Logo

Valentino Urbano


Published

Image

Valentino Urbano

iOS Developer, Swift, Writer, Husband

Back to Overview