2

I am not able to get NSLog messages on /var/log/system.log. Where the messages are going can someone please help me out. Or is there any configuration missing.

nisarga lolage
  • 531
  • 1
  • 5
  • 14

1 Answers1

1

Starting with macOS Sierra / iOS 10 Apple introduced a new unified logging mechanism, which NSLog is redirected to. This logging mechanism doesn't store messages in /var/log/system.log anymore. It stores messages in a binary form elsewhere. You're supposed to use either the Console app or the log command to view the logs.

By the way, the Console app has been reworked, and it's pretty good.

For more details, please, see WWDC 2016 - Session 721: Unified Logging and Activity Tracing

FreeNickname
  • 7,398
  • 2
  • 30
  • 60
  • 1
    I saw this session, and it gives absolutely no answer to the basic question: WHERE ARE MY LOGS. I cannot find my NSLog() messages in the Console - the only thing I can do is see the LIVE if I click the device, and search for my App's process. The moment my app quits - they disappear forever. I find this session so frustrating - because it only burdens me with new APIs and responsibilities - but without any ability to save logs, archive them, extract them or otherwise use them. Some VERY BASIC information is missing there. I will be forever thankful if you try to complete the gap. – Motti Shneor Feb 27 '18 at 08:26
  • @MottiShneor This post should help you: https://blackbagtech.com/blog/2017/09/22/accessing-unified-logs-image . I've also summarized it at this answer: https://stackoverflow.com/a/49081487/548975 – shane Mar 03 '18 at 06:47