Page 1 of 1

Reading IOLog from the device

PostPosted: Thu Oct 27, 2016 10:24 am
by doadam
Hey,

A lot of functions in the kernel use IOLog and it can definitely make your life easier when trying to understand what's going on while blackboxing the kernel.
Unfortunately, /var/log/system.log does not exist on iDevices and hence I'm a little bit confused regarding where I should find the output of IOLog.

I tried socating /var/run/lockdown/syslog.sock dmesg but the IOLog from the kernel itself do not appear there (I did see a "kernel" process there, but my logs, which are complied in the binary, do not appear there even though the code works as expected).

Could anyone please shed some light about how to get the logs from IOLog?


Best regards,
Adam.

Re: Reading IOLog from the device

PostPosted: Thu Nov 03, 2016 1:07 am
by morpheus
IOLog goes to dmesg. You might need to also set debug.iokit via sysctl.
You can get dmesg output programmatically using proc_info (#336) , which is wrapped by libproc.h:

Code: Select all
int proc_kmsgbuf(void * buffer, uint32_t buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);


Bear in mind however you need UID 0 for that.