Cocoalumberjack: Retrieving System logs on top of regular logs in iOS 10

Created on 14 Oct 2016  路  4Comments  路  Source: CocoaLumberjack/CocoaLumberjack

New Issue Checklist

| Info | Value |
| --- | --- |
| Platform Name | iOS |
| Platform Version | 10.0 |
| CocoaLumberjack Version | 2.3.0 |
| Integration Method | manually |
| Xcode Version | Xcode 8.0 |
| Repro rate | all the time (100%) |

Issue Description and Steps

Prior to iOS 10, I could create an instance of an ASL Logger, and set it up to capture the system logs coming out of NSLog in other frameworks that our app was using, like so:
DDASLLogCapture.setCaptureLevel(.All)
DDASLLogCapture.start()

However, with iOS 10 now, this no longer works. In the file DDASLLogCapture.m, the entirety of capturing the system logs comes out of banking off of notifications from the system that there's new log messages in the database with the key kNotifyASLDBUpdate which is equal to "com.apple.system.logger.message". This key doesn't seem to have changed in iOS 10, as I can inspect the notify_keys.h file in order to view them, but the notifications don't occur in iOS 10, I'm assuming as a result of moving over to os_log.

This being the case, what can be done now to retrieve system logs that were being directed to console output that are no longer being picked up by the DDASLLogCapture object?

Stale

Most helpful comment

ASL was replaced by os_log. And with os_log, AFAIK there's no way to gather logs inside the app. So I don't think this is solvable.

All 4 comments

Any progress?

@CodeLife2012 well yes and no. I know _why_ this doesn't work anymore. In iOS 10, Apple no longer puts the asl log file in a place that's accessible and poll-able by the user, as it was in iOS 9. I get why they did, for security reasons anyways, as sometimes we log stuff that maybe shouldn't be visible to everyone. However, as a result of this change, CCL no longer works the way that it did before in this respect. In fact, I'm not sure if there's any way to circumvent this, unless you redirect everything to the stderr stream which you would still be able to access from my understanding but kind of defeats the whole purpose. I'd be interested if anyone from the team or community had thoughts on this issue and whether there was a way to get back all the system logs we now miss out on in iOS 10.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still an issue, please make sure it is up to date and if so, add a comment that this is still an issue to keep it open. Thank you for your contributions.

ASL was replaced by os_log. And with os_log, AFAIK there's no way to gather logs inside the app. So I don't think this is solvable.

Was this page helpful?
0 / 5 - 0 ratings