Hello Apple support,
We are trying to figure out how to persist the activity logs and retrieve it. It seems the obvious place to find them is "Analytics & Improvements" in settings.
- How are the .ips log generated? (OSLog?)
- What are the conditions for the iOS to store the logs?
We are aware of this post, but no info on the storage of logs
No worries. I can remove tags. I just wanted to make sure we’re talking about the same stuff (-:
Coming back to your original questions, be aware that crash reports and the system log are different things. They’re only related in the sense that, when the system generates a crash report, info about that process is logged to the system log.
As to how these are implemented, be aware we’re talking about implementation details here, not APIs. As such, anything I say is subject to change.
Currently crash reports are recorded in JSON format as .ips
files. These are standalone files, saved on the device’s data volume. Your app does not have access to them.
The system log is much more complex. In Your Friend the System Log you’ll find a reference to a WWDC 2016 session that discusses how it works in detail. Sadly, that video is no longer available from Apple, but you might be able to use that link to find adjunct info from other place’s on the ’net.
In short:
-
The system log has complex logic to filter out log entries on the client side.
-
If the client decides to log something, it writes it to a memory buffer that’s shared with the logging daemon.
-
The logging daemon has complex logic to decide whether a log entry should be written to disk, that is, persisted.
-
If it is, the logging daemon does that in chunks, compressing each chunk before writing it.
-
The logging daemon will prevent the log from growing without bound by expiring log entries.
None of this is visible to you. There are APIs to inspect the system log, albeit with significant caveats, especially on iOS. Your Friend the System Log has the details.
If you have follow-up questions, post them in a reply and I’ll see what I can do to help out.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"