2021-09-07 21:35:14 +01:00
|
|
|
# log
|
|
|
|
|
|
|
|
> View, export, and configure logging systems.
|
2024-01-31 10:20:27 +00:00
|
|
|
> More information: <https://keith.github.io/xcode-man-pages/log.1.html>.
|
2021-09-07 21:35:14 +01:00
|
|
|
|
|
|
|
- Stream live system logs:
|
|
|
|
|
|
|
|
`log stream`
|
|
|
|
|
|
|
|
- Stream logs sent to `syslog` from the process with a specific PID:
|
|
|
|
|
|
|
|
`log stream --process {{process_id}}`
|
|
|
|
|
|
|
|
- Show logs sent to syslog from a process with a specific name:
|
|
|
|
|
|
|
|
`log show --predicate "process == '{{process_name}}'"`
|
|
|
|
|
|
|
|
- Export all logs to disk for the past hour:
|
|
|
|
|
|
|
|
`sudo log collect --last {{1h}} --output {{path/to/file.logarchive}}`
|