Reading IOLog from the device

Questions and Answers about all things *OS (macOS, iOS, tvOS, watchOS)

Reading IOLog from the device

Postby doadam » Thu Oct 27, 2016 10:24 am

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.
doadam
 
Posts: 3
Joined: Mon Aug 29, 2016 1:24 pm

Re: Reading IOLog from the device

Postby morpheus » Thu Nov 03, 2016 1:07 am

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.
morpheus
Site Admin
 
Posts: 532
Joined: Thu Apr 11, 2013 6:24 pm


Return to Questions and Answers

Who is online

Users browsing this forum: No registered users and 1 guest