4 Replies
      Latest reply: Oct 26, 2016 2:07 AM by eskimo RSS
      liszt Level 2 Level 2 (35 points)

        I am not having any success with using os_log in my KEXT.  I've tried with both the OS_LOG_DEFAULT log and creating a specific log with os_log_create.  Regardless of the code I try, I cannot see the KEXT log messages in Console.app.  Same with using the command line log stream --level debug --predicate 'subsystem == "com.example.subsystem"' (and without subsystem filtering).   Am I missing something here?

        • Re: os_log in kernel
          liszt Level 2 Level 2 (35 points)

          The os_log functions are working in my kext, but it appears that os_log_create is not working as expected.  Whether I use OS_LOG_DEFAULT or a custom subsystem/category from os_log_create, the log command does not show a subsystem or category attached to os_log messages from my kext.  The log config settings do not seem to change the subsystem/category behavior.

            • Re: os_log in kernel
              liszt Level 2 Level 2 (35 points)

              As a workaround for what I want (filtering the log stream for my subsystem's messages), I found that I can pass log stream a predicate like --predicate 'senderImagePath == "/Library/Extensions/MyKext.kext/Contents/MacOS/MyKext"'.

              • Re: os_log in kernel
                liszt Level 2 Level 2 (35 points)

                Filed bug report 28948441.

                  • Re: os_log in kernel
                    eskimo Apple Staff Apple Staff (6,785 points)

                    Filed bug report 28948441.

                    I don’t know what’s going on here, alas, but I wanted to thank you for posting follow ups and for filing that bug report.

                    Share and Enjoy

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