QorumLogs icon indicating copy to clipboard operation
QorumLogs copied to clipboard

Add support for batch sending logs

Open camclendenin opened this issue 8 years ago • 1 comments

Sending dozens and dozens of logs per session seems like wasted overhead. I'd prefer to store logs throughout the user's session, then send the stored logs in a single request the next time the user foregrounds the app (or possibly attempt to send them when the user backgrounds the app). This would remove the wasted overhead associated with numerous smaller HTTP requests (headers). You would definitely need local persistence of some kind. I'd also like to know that things like logs couldn't potentially be slowing down other HTTP requests that are actually critical - this is particularly a concern on mobile devices in limited bandwidth conditions.

camclendenin avatar Jun 14 '16 16:06 camclendenin

This sounds like a good feature. However this repo is not meant for your standard analytics. Its supposed to catch the niche events or possible errors you might have in code.

Here is an example of how I use it: http://prntscr.com/bgcud5

As you see there is only a few event per day. For my type of use this kind of optimization isn't needed. But if you want to use it like an analytics service then storing logs and sending them in batches makes sense.

I also use fabric and mixpanel for other stuff.

If you'd like to add this feature, it can be an optional setting in the repo. Probably saving in nsuserdefaults, cause its lightweight and somehow sending in batches.

Esqarrouth avatar Jun 14 '16 18:06 Esqarrouth