Logging

Power Manager maintains an audit log detailing the what, when, and why of the Scheduler's behaviour. The log provides an invaluable insight into how the Scheduler is performing.

Power Manager’s scheduler writes a log to:

/Library/Logs/uk.co.dssw.powermanager/uk.co.dssw.powermanager.pmd.log

Each assistant writes a log within their user’s log folder:

~/Library/Logs/uk.co.dssw.powermanager/uk.co.dssw.powermanager.assistant.log

Logs are automatically rotated, compressed, and removed over time. By default, 90 days of logs are retained.

Viewing the Logs

Power Manager’s logs can be viewed and monitored using macOS’s included Console.app. The logs are visible in the Log Reports panel:

All log files written by Power Manager begin with the prefix uk.co.dssw.powermanager..

Levels and Format

Power Manager does not record every log entry issued. Log entries have priorities, and only the higher priority entries are recorded. This is a deliberate design decision to help keep the logs free from debugging clutter and, normally, trivial content.

If you are experiencing problems, or want to know more about how Power Manager works, you can adjust the level of detail that will be recorded to the log.

Levels

The default log filter level is notice. This means log entries with levels below notice are not stored or displayed. Log entries with a tag of notice or higher, are stored and displayed in the log.

The levels are listed below in order of most important at the top, emergency, to least important at the bottom, debug.

Structured Text

Power Manager writes log files in a structured text based format. Each line contains a log entry, with a prefixed time stamp, then message. Following the message are zero or more tagged attributes.

Structured log entries allow Power Manager to create log entries that contain tags specific to an event, trigger, condition, or action. Scripts and tools can filter log entries by tags to quickly reveal information specific to an event, trigger, condition, or action.

The log format is subject to change and should not be relied upon for long term tooling.

Set Filter Request

The log API offers control over the amount of detail included in the log files. Administrator privileges are required to read and write log settings.

Enabling all log entries

To increase the amount of detail logged, issue the commands below:

cd '/Applications/Power Manager.app/Contents/Tools'
./pmctl log.setfilterlevel "level=debug"

Restoring default log entries

To restore the log detail to the default, issue the commands below:

cd '/Applications/Power Manager.app/Contents/Tools'
./pmctl log.setfilterlevel "level=notice"

Log Override

To support detailed logged during deployment and initial launch, Power Manager’s scheduler looks for an override file on launch. If this file exists, logging is fixed to the debug level. When the override file is in use, the scheduler’s log.filterlevel value is ignored.

To create the override file and restart the scheduler:

sudo touch '/Library/Application Support/Power Manager/log.override'
sudo killall uk.co.dssw.powermanager.pmd

To remove the override file and restart the scheduler:

sudo rm '/Library/Application Support/Power Manager/log.override'
sudo killall uk.co.dssw.powermanager.pmd