> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getprimo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Event logging

> Set how long your Macs keep their install log, and how Windows devices size, protect and forward their event logs and log PowerShell activity.

The Event logging control sets how your devices keep their logs. On a Mac, set how long the install log is kept. On Windows, set the size, retention, location and access of the Application, Security, Setup and System logs, forward events to a collector, encrypt protected event logs, and log PowerShell activity.

## Platform compatibility

| macOS | Windows | Linux | iOS / iPadOS | Android |
| - | - | - | - | - |
| ✅ | ✅ | | | |

Requires macOS 15 or later.

## Set up the control

**1. Add a configuration**

Go to **MDM** > **Controls** and open **Event logging**. Select the platform tab, then click **Add configuration**.

**2. Configure the settings**

Set each setting you want to enforce. See the settings below. On Windows, set at least one setting.

**3. Select targeting**

Choose which devices to apply the configuration to: all devices on that platform, specific device groups, or a custom target. Click **Activate** to deploy the configuration. **Save** keeps it inactive.

## Settings

> [tab] macOS
>
> | Setting | Value |
> | - | - |
> | **Install log retention (days)** | A whole number of days between 1 and 3650. 365 by default, what macOS keeps on its own. |
>
> This is how many days the Mac keeps `/var/log/install.log`. Any size cap on the log is removed so that it isn't purged sooner.

> [tab] Windows
>
> A setting left empty or on **Not configured** isn't written: the device keeps its own setting.
>
> The **Application log**, **Security log**, **Setup log** and **System log** sections each hold:
>
> | Setting | Options |
> | - | - |
> | **Maximum size (KB)** | From 1024 KB, or 20480 KB for the Security log |
> | **Keep old events when the log is full** | **On**, **Off** |
> | **Back up the log when it is full** | **On**, **Off** |
> | **Log file path** | The full path of the `.evtx` file, in a folder the Event Log service can write to |
> | **Log access (SDDL)** | An SDDL security descriptor, applied to both the log access and the legacy log access |
>
> Two more settings belong to one log:
>
> * **Setup log** > **Logging**: **On** or **Off**.
> * **Security log** > **Warn when the log reaches**: **50%**, **60%**, **70%**, **80%** or **90%**.
>
> Under **Event forwarding**:
>
> | Setting | What to enter |
> | - | - |
> | **Subscription managers** | One per line, up to 20, such as `Server=http://collector:5985/wsman/SubscriptionManager/WEC,Refresh=60` |
> | **Maximum forwarding rate (events per second)** | 1 to 100000 |
> | **Protected Event Logging certificate** | The thumbprint, the Base64 content or the file path of a Document Encryption certificate |
>
> Under **PowerShell logging**:
>
> | Setting | Options |
> | - | - |
> | **Script block logging** | **On**, **On, with the start and end of each invocation** |
> | **Module logging** | Module names separated by commas, up to 100, such as `Microsoft.PowerShell.*`, or `*` for every module |
> | **Transcription** | **On**, **On, with a header for each command** |
> | **Transcript folder** | The folder where PowerShell writes its transcripts |

## How it works

> [tab] macOS
>
> Primo runs a script on each Mac and checks the result with a policy. The script saves the Mac's own rule for the install log, then sets its retention. The rest of the log configuration stays as macOS or an administrator left it.
>
> If someone edits the install log rule on the Mac, the policy fails and Primo runs the script again.
>
> When you remove the configuration, Primo puts back the Mac's own rule.

> [tab] Windows
>
> Primo applies the settings through Windows event log, event forwarding and PowerShell policies for the whole device.
>
> * **Subscription managers** tells the device which Windows Event Collector to send its events to. The collector still needs a subscription that picks the events.
> * **Protected Event Logging certificate** encrypts the events that support it, such as PowerShell script block events, with this certificate.

## Modify or remove the control

Open the control from **MDM > Controls** to edit, deactivate or replace a configuration.

## Related articles

* [Controls overview](https://docs.getprimo.com/mdm/policies/overview.md)
* [Audit policy](https://docs.getprimo.com/mdm/policies/audit-policy.md)
* [System file permissions](https://docs.getprimo.com/mdm/policies/system-file-permissions.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.