How to easily store and access logs from my running iOS app using the new Logger system?

Viewed 110

I've read a lot of documentation which tells me to use macOS' Console app to access the supposedly stored logs but I can't for the life of me get it to work.

This is what I am doing:

  1. Created several Logger(subsystem: "Some.Name", category: "SomeCategory") through my app following documentation.
  2. Created several log calls to the aforementioned loggers in my codebase, as stated in the documentation.
  3. These seem to work perfectly fine as I can see all my logs in Xcode's console live while running my app in debugging mode through Xcode. Up to this point the experience has been perfect.
  4. But I want these logs to be stored somewhere persistently though, so I can see what caused a crash that happened while my device was not connected to my macbook running Xcode. I tried using my macbook's Console app following these instructions, but all I can see is a live flood of my iPad's event logs, which for some reason don't contain the logs I coded myself, they instead consist of random framework logs from my app like CoreData logs for example.

My google skills have been failing me with this particular problem, and I can't believe how difficult this has been, I probably should've just used a text file for logging at this point. Well, if anybody has any insight on this I'd be immensely thankful.

0 Answers
Related