Read macOS Kernel Logs With log show and log stream
Read kernel and driver messages on macOS 15 with log show and log stream, using predicates on process, subsystem and message text, plus time ranges and levels.

On macOS there is no /var/log/messages full of kernel lines, and dmesg shows only a thin slice of what the kernel said. Since macOS 10.12 the system writes its messages into a binary store called the unified log, and the one tool that reads it is log. That makes the first lookup feel unfamiliar, and it makes the second one fast, because the store is indexed and you filter it with predicates instead of grepping megabytes of text. This post teaches the two subcommands you need on macOS 15, log show for the past and log stream for the live feed, and shows how to select kernel messages, a driver, a time window and a severity. It pairs with inspecting kernel state with sysctl and ioreg and sits inside the macOS kernel internals guide.
How the unified log is organized
Every message in the log is an entry with fields you can filter on. The ones that matter first are:
| Field | Meaning | Example |
|---|---|---|
process | Name of the sending process | kernel, Safari, bluetoothd |
processImagePath | Full path of the executable | /kernel |
subsystem | A reverse-DNS label chosen by the code that logs | com.apple.iokit.IOUSBHostFamily |
category | A finer label inside a subsystem | device |
eventMessage | The message text | Device removed |
messageType | Severity: default, info, debug, error, fault | error |
sender | The binary image that logged it, such as a kernel extension | AppleUSBHost |
Kernel code logs with os_log in the same way a user process does, so kernel messages are entries whose process is kernel. Many are also written by drivers with a subsystem label, which makes them easy to select.
Two properties of the store surprise people. First, it keeps only a limited history, held in files under /var/db/diagnostics, with older entries removed automatically, so a message from last month may be gone. Second, info and debug messages are not persisted by default. They exist in memory for a short time and are kept only if logging for that subsystem was enabled. A missing detail message therefore does not prove the event did not happen.
Show the past with log show
log show prints stored entries. Run with no filter it prints everything, which is far too much, so always give it a time limit and a predicate. The time limit options are --last with a duration, --start and --end with a date:
log show --last 5m --predicate 'process == "kernel"' | head -8Timestamp Thread Type Activity PID TTL
2025-11-23 10:14:02.318811+0100 0x1b2 Default 0x0 0 0 kernel: (AppleUSBHost) Device connected, port 3
2025-11-23 10:14:02.331904+0100 0x1b2 Default 0x0 0 0 kernel: (IOUSBHostFamily) Configuring device 0x046d:0xc31c
2025-11-23 10:15:41.020117+0100 0x41c Default 0x0 0 0 kernel: (AppleBCMWLAN) link state changedThe entries are an example, and what you see depends on your hardware. Each line shows the timestamp, the thread, the message type, the activity identifier, the PID (0 for the kernel), then the sender in parentheses and the message text. The (AppleUSBHost) part is the kernel extension that logged it, which is the quickest way to know which driver was talking.
The duration after --last takes s, m, h and d, so --last 2h is two hours and --last 1d is a day. For an exact window:
log show --start '2025-11-23 10:00:00' --end '2025-11-23 10:30:00' --predicate 'process == "kernel"'Dates are interpreted in the local time zone.
Write a predicate
The --predicate argument is an NSPredicate string, the same query language Apple's frameworks use. You combine comparisons with AND, OR and NOT, and the operators you need are ==, !=, CONTAINS, BEGINSWITH, ENDSWITH, MATCHES and IN. String comparison is case-sensitive unless you add [c] after the operator.
log show --last 1h --predicate 'process == "kernel" AND eventMessage CONTAINS[c] "usb"'
log show --last 1h --predicate 'subsystem == "com.apple.iokit.IOUSBHostFamily"'
log show --last 1h --predicate 'sender == "AppleUSBHost" AND messageType == error'Always quote the whole predicate in single quotes so the shell does not interpret it, and use double quotes for string literals inside it. A frequent failure is an unquoted == or a missing closing quote, which produces a parse error from the command and no output.
Some predicates we use again and again:
| Question | Predicate |
|---|---|
| Everything from the kernel | process == "kernel" |
| Kernel errors and faults only | process == "kernel" AND (messageType == error OR messageType == fault) |
| One driver by its binary | sender == "AppleBCMWLAN" |
| Sleep and wake | eventMessage CONTAINS "Wake reason" OR eventMessage CONTAINS "Sleep" |
| A specific process | process == "bluetoothd" |
| Crash reports being written | process == "ReportCrash" |
The kernel text depends on the chip and the release, so find the exact phrase by searching broadly first with CONTAINS[c], read a few lines and then tighten the predicate.
Stream the present with log stream
log stream prints new entries as they arrive and keeps running until you press Control-C. It accepts the same --predicate syntax, and it is the tool to use when you can trigger the event yourself: plug in a device, then watch what the kernel says.
log stream --predicate 'process == "kernel" AND eventMessage CONTAINS[c] "usb"' --level infoFiltering the log data using "process == "kernel" AND eventMessage CONTAINS[c] "usb""
Timestamp Thread Type Activity PID TTL
2025-11-23 10:22:07.114520+0100 0x1b2 Default 0x0 0 0 kernel: (AppleUSBHost) Device connected, port 3Leave the command running in one Terminal window, then plug in the device. The entries appear within a second, and when you unplug it you should see the matching removal line. This simple observe-while-you-act loop is the best way to learn what a driver prints in normal operation, which is what you compare against when something goes wrong.
The --level option controls verbosity: default shows normal messages, info adds informational ones and debug adds everything, including messages that are normally kept only in memory. log stream honors it, and log show has --info and --debug switches for the same purpose, but debug entries appear in log show only if they were stored.
Choose a readable format
The default output is compact but wide. Two options help. --style compact prints a shorter line with a one-letter message type, and --style json or --style ndjson print structured entries you can feed to jq:
log show --last 10m --predicate 'process == "kernel"' --style ndjson | head -1{"traceID":123456,"eventMessage":"(AppleUSBHost) Device connected, port 3","eventType":"logEvent","source":null,"formatString":"%s","activityIdentifier":0,"subsystem":"","category":"","threadID":434,"senderImageUUID":"...","processImagePath":"\/kernel","timestamp":"2025-11-23 10:14:02.318811+0100","messageType":"Default","processID":0,"senderImagePath":"\/System\/Library\/Extensions\/AppleUSBHost.kext\/Contents\/MacOS\/AppleUSBHost","machTimestamp":987654321,"parentActivityIdentifier":0,"timezoneName":"","processImageUUID":"...","senderProgramCounter":0}The identifiers and counters are examples. Notice senderImagePath in the output. It names the exact kernel extension file that logged the message, which is the clearest answer to "which driver said this". With jq you can pull a field out of every entry, for example jq -r '.eventMessage', and count messages per sender with jq -r '.senderImagePath' | sort | uniq -c | sort -rn.
Collect an archive for later
A log store can be copied and read on another machine, which matters when you debug a Mac you cannot sit at. log collect writes a .logarchive bundle from the local store:
sudo log collect --last 1h --output ~/Desktop/kernel.logarchive
log show --archive ~/Desktop/kernel.logarchive --predicate 'process == "kernel"'The --archive option makes log show read the bundle instead of the live store, so the same predicates work on a file someone sent you. sudo is needed because collecting reads protected files. A sysdiagnose also includes a log archive among its contents. Treat an archive as sensitive: kernel and daemon entries can include device names, network names and identifiers.
What about dmesg
dmesg still exists on macOS and prints the kernel's message buffer, but that buffer is a small ring and holds only part of the kernel's output, since most kernel logging now goes to the unified log. Use dmesg as a quick look at early boot text, and log show for everything else. The older /var/log/system.log is also no longer the main destination, so do not expect to grep it for driver messages on a current release.
Private data and redaction
Many log messages contain values that Apple's logging marks as private, such as file paths, usernames and device names, and the log shows them as <private> unless the system is configured to reveal them. A line may read kernel: (X) opened <private>. That is by design. You cannot normally turn it off for system processes without changing the configuration that protects user data, and you should not do that on a machine that matters. When the text you need is redacted, look for a different field, such as the activity or the sender, or write your own code to log the value as public while debugging your own software.
Where this does not fit
The unified log tells you what code chose to say, and many failures say nothing. A hang with no log entry, a driver that never loaded and a panic that happened before logging started all leave this store empty, and the places to look then are the panic reports in /Library/Logs/DiagnosticReports, the output of kmutil showloaded and a serial console or a debug kernel. Another limit is retention. A message from a week ago may be gone, so for an intermittent fault start log stream or log collect close to the event. And if you are writing logging code of your own, use os_log with sensible subsystems and categories from day one, because the filters in this post are only as good as the labels the code supplied.


