How can I log to a file?

I am having internet connection issues on client sites. I want to be able to log to a file /non internet source. How can I do this on an iPad? Something like log4net allows would be perfect. I can log to multiple places.

I need offline logging. If it logs to the DB after it comes back online that’s fine. I just need logging when internet is down.

Ionic 3. Plugins are fine.

Can you be a bit detailed with your request?