Skip to content
Erik Gomez edited this page Feb 16, 2021 · 12 revisions

Streaming

Nudge uses os_log for all logging, this streams logs to then built in logging system.

You can view these logs in Terminal using

log stream --predicate 'subsystem == "com.github.macadmins.Nudge"' --info --style syslog --color none

Using the --level flag you can set the displayed logs to debug, info, warning, or error.

Or make them more parsable using the json flag

log show --predicate 'subsystem == "com.github.macadmins.Nudge"' --info --style json --debug

Archiving

There is the option of using sudo log collect to collect all of the system logs into a .logarchive and then review it using the --source flag in log show

Storing in a log file

Because these logs are only streaming they're not stored for very long (depending on the level). If you want non-ephemeral logs then you should setup a Launch Daemon that streams the logs into a file

An example LaunchDaemon can be found here https://github.com/macadmins/nudge/blob/main/build_assets/com.github.macadmins.Nudge.logger.plist. This will at launch start writing the logs to /var/log/nudge.log which you can either tail or open with the Console app.

This LaunchDaemon is also offered as an optional signed package for installation.

Clone this wiki locally