3 Replies
      Latest reply: Mar 10, 2017 3:42 AM by eskimo RSS
      jamieBAF Level 1 Level 1 (15 points)

        I have done the following:

         

        Still, I cannot figure out how to send a log file.

         

        In this Apple Technical Note it states:

         

            "In iOS 10+, use the Unified Logging APIs rather than NSLog, printf, and print."

         

        But also:

         

            "Provide a way for the user to send that log to you."

         

        I am able to log using the os_log and related APIs.  But how to send it anywhere?  I know it would be in binary format (an .logarchive file?) and require it to be viewed by the new console.app. 

        • Re: How to send logs using Unified Logging?
          eskimo Apple Staff Apple Staff (6,065 points)

          One way to get os_log results from the user is via sysdiagnose.  If the user takes a sysdiagnose, recent log entries will be captured therein.  Once you unpack the resulting sysdiagnose_xxx.tar.gz file, you’ll find system_logs.logarchive file that you can explore with the log tool or the Console utility on macOS 10.12.

          There are instructions on how to take a sysdiagnose on the Profiles and Logs page.

          Share and Enjoy

          Quinn “The Eskimo!”
          Apple Developer Relations, Developer Technical Support, Core OS/Hardware
          let myEmail = "eskimo" + "1" + "@apple.com"

            • Re: How to send logs using Unified Logging?
              ernielovesapple Level 1 Level 1 (0 points)

              Is there a way to get all those os_log results without connecting the iPhone to a Mac?

               

              Can we get the log info from user remotely? like user taps a button inside the app, and the console log info can be sent to a specific email address?

               

               

              or for internal testing purpose

              Can we print the log info into an UITextView inside one of our app pages so that the testers can see all the log info on the app directly without conncecting the iPhone to a Mac (we have many iPhones but not enough Macs in our company)?

                • Re: How to send logs using Unified Logging?
                  eskimo Apple Staff Apple Staff (6,065 points)

                  Is there a way to get all those os_log results without connecting the iPhone to a Mac?

                  Not that I’m aware of (well, you can use a Windows machine but I don’t think that’s what you meant :-).

                  Can we get the log info from user remotely? like user taps a button inside the app, and the console log info can be sent to a specific email address?

                  No.

                  Can we print the log info into an UITextView …

                  I responded to this on your other thread.

                  Share and Enjoy

                  Quinn “The Eskimo!”
                  Apple Developer Relations, Developer Technical Support, Core OS/Hardware
                  let myEmail = "eskimo" + "1" + "@apple.com"