Unified logging: need an easy way for users to share app logs with third-party developers

Number:rdar://42469365 Date Originated:July 21 2018
Status:Duplicate (Open) Resolved:
Product:iOS + SDK Product Version:
Classification: Reproducible:
Currently, I use NSLog in my app, rather than os_log. I would like to switch, but os_log seems to be lacking in one important area: gathering logs from a user to send to the developer.

With NSLog I can have a switch in my iOS or macOS app that redirects stderr to a file. The user can turn that on, recreate the problem, and just tap a button to email the file. Super simple.

With os_log, this doesn't work. Of course there's sysdiagnose, but that requires a complicated button combination, scrolling through a list of hundreds of other log files, and then… basically the only option is to try to email me a 200MB file. If they use Mail, Mail Drop is enabled, and they're on Wi-Fi, that should be OK. But often they won't have any simple way to get me the data. I'm sure sysdiagnose is great if you're troubleshooting OS issues, and have the Feedback app to simplify the process for users, but for a third-party developer it's really frustrating that this is the only solution.

I was originally planning to create my own wrapper for os_log, even though it's recommended against (see https://developer.apple.com/videos/play/wwdc2016/721/?time=2335). That way I could have it write to a file as needed, or just pass the data to os_log the rest of the time. But it seems there's actually no good way to do that, due to the problems described here: https://stackoverflow.com/questions/50937765/why-does-wrapping-os-log-cause-doubles-to-not-be-logged-correctly

I know I'm far from the only developer frustrated by this. See here for just one other example: https://twitter.com/parrots/status/1011269415327944707

To sum up, here are the things I'd like to see:

- Most importantly, some way to gather just the logs for my own app, in a file that is no more than a few megabytes.

- Ideally, some way to start this gathering process from within my own app. I would settle for a way to do this from the TestFlight app, but I'd prefer a method that works for App Store releases as well.

- Ideally, a way for my app to access the log file so I can make it simple for my customers to share the logs with me. If they have to find it themselves, it would at least be nice to have a search bar on the Settings > Privacy > Analytics > Analytics Data screen.

Thanks for listening.


Duplicate of 26788524 (Open)

See here for some additional related bug reports: https://pspdfkit.com/blog/2019/logs-for-your-crash-reports/

By robotspacer at March 6, 2019, 6:50 p.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!