Storing logs from application written in Swift visible on real device

I folks,

I have an application that is already available in production and I would like to store some logs to the app, so that on real device I will see outputs for better tracing.

iOS13 would be fine, but I can migrate it into e.g. iOS 14.

The next question is where to find logs on real devices, so that users can send me for tracing.

Thanks Petr

Answered by DTS Engineer in 836580022

There are two standard approaches for this:

  • Log to the system log, and then have the user trigger a sysdiagnose log and send you that. This is kinda clunky for the user, but it yields the most logging.

  • Log to wherever you want, and then provide a UI in your app that lets the user share your log. This is easy for the user, but you only get log entries that you generated.

There are other approaches you might take — for example, you could put your logs in the Documents directory and then expose that to the Files app — but they don’t offer significant benefits over the above.

For more information about the system log, see Your Friend the System Log.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

There are two standard approaches for this:

  • Log to the system log, and then have the user trigger a sysdiagnose log and send you that. This is kinda clunky for the user, but it yields the most logging.

  • Log to wherever you want, and then provide a UI in your app that lets the user share your log. This is easy for the user, but you only get log entries that you generated.

There are other approaches you might take — for example, you could put your logs in the Documents directory and then expose that to the Files app — but they don’t offer significant benefits over the above.

For more information about the system log, see Your Friend the System Log.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Storing logs from application written in Swift visible on real device
 
 
Q