2

I began kernel programming on mac.

Because I want to run my kernel extensions without code signing I had to do the following:

sudo nvram boot-args=kext-dev-mode=1

It works as it should be, but the problem is that I can't find my kernel.log file.

I opened Console app and even there under FILES there is no kernel.log, I have listed all the other files except that one.

Any suggestions where can I find my kernel.log file?

I need it for debug purposes.

1

On Yosemite, those kernel messages should be logged to System.log according to /etc/asl.conf, which replaced the older syslog.conf. Apple System Logger and Syslog both use /etc/asl.conf

 # Rules for /var/log/system.log 
 > system.log mode=0640 format=bsd rotate=seq compress file_max=5M all_max=50M
 ? [= Sender kernel] file system.log

Kernel.log is not used by any logger since 10.8 I believe, but confirmed in 10.10.x

Note, El Capitan and SIP removed support for kext-dev-mode, so keep that in mind if you need to debug in newer OS X versions.

  • 3
    Do you have any idea why simple printf() doesn't get logged? I load the example with sudo kextload, then check with kextstat if it was loaded and it is and then I unload the example with sudo kextunload and again check if everything is OK - and it is. – Matic1911 Mar 3 '16 at 10:14
  • In OSX 10.9.5 I can't find /var/log/kernel.log, so it seems to be removed also in that version. So it makes sense that it was removed in 10.8. – Magne Oct 17 '17 at 8:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .