> For the complete documentation index, see [llms.txt](https://docs.pharos.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pharos.ai/configuration-guide/monitoring/logs.md).

# Logs

Configure log monitoring rules to detect spikes, user impact, and recurring patterns.

Log monitoring rules detect patterns in error volume, user impact, or recurring failures within a time window. When a rule's threshold is breached, Pharos creates an **Event** record and triggers notifications. Unlike notification rules (which fire per log/issue), monitoring rules analyze **aggregate log data** over time.

{% hint style="info" %}
Monitoring rules only operate on **logs**. You cannot create issue-based monitoring rules. For per-log or per-issue alerting, use [Notification Rules](https://docs.pharos.ai/configuration-guide/notifications.md) instead.
{% endhint %}

***

## Accessing Monitoring Rules

**Navigate:** Pharos App → **Pharos Admin** → **Monitoring**

Before configuration, the page shows the **Enable Monitoring** toggle in the off state:

![Monitoring Rules — disabled state](https://4264222071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdl9tmJ56lvwg5XY63QYr%2Fuploads%2Fgit-blob-ffff134af141706a3bebc70a0e53050414063bb9%2Fmonitoring-rules-disabled.png?alt=media)

Once enabled with rules configured, the page shows a list of all monitoring rules with their type, description, notification channels, and active status:

![Monitoring Rules — enabled with active rules](https://4264222071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdl9tmJ56lvwg5XY63QYr%2Fuploads%2Fgit-blob-4e79795b8cf42e5ad79a32a0751b8e5481dc5c8b%2Fmonitoring-rules-enabled.png?alt=media)

The toggle **Show Inactive** lets you see deactivated rules alongside active ones.

***

## Rule Types

Pharos supports three types of monitoring rules. When creating a rule, select the type under **Rule Type**:

### Spike

> *Track bursts of events based on count, average count and time intervals. Use this rule type to identify sudden occurrences of events that might require immediate action.*

![Rule Type — Spike selected](https://4264222071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdl9tmJ56lvwg5XY63QYr%2Fuploads%2Fgit-blob-bd59203ce6176ff6de355eb6d349122d9ef591a5%2Frule-form-spike.png?alt=media)

A Spike rule fires when the number of log records within the time interval exceeds the threshold. This is the most common rule type.

**Best for:** Integration outages, batch job failures, deployment-related error surges.

**How it works:**

![Spike — simple concept: Event Count exceeds Threshold within Interval](https://4264222071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdl9tmJ56lvwg5XY63QYr%2Fuploads%2Fgit-blob-5cde1627c15a7e250af7560c91624ff454790a1a%2Fspike-simple.png?alt=media)

With an **Average** threshold type, the system subdivides the interval into aggregate intervals and computes a rolling average:

![Spike — detailed: Aggregate Intervals with Avg 1, Avg 2, Avg 3](https://4264222071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdl9tmJ56lvwg5XY63QYr%2Fuploads%2Fgit-blob-3194f0293a4489bd943470807568641f77db01ce%2Fspike-detailed.png?alt=media)

### Impact

> *Gauge the impact of a particular event among the user base. It's based on user counts and time intervals. Use this rule type to identify issues that are impacting users.*

![Rule Type — Impact selected](https://4264222071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdl9tmJ56lvwg5XY63QYr%2Fuploads%2Fgit-blob-bd7a1f9aa674f19f19872a74661204cf313e07a9%2Frule-type-impact.png?alt=media)

An Impact rule fires when the number of **unique users** experiencing errors within the interval exceeds the threshold. If one user sees 10 errors and another sees 5, that counts as **2 users impacted** — the rule counts distinct users, not total errors.

**Best for:** User-facing problems, broad org impact, deployment regressions affecting end users.

**How it works:**

![Impact — simple concept: Distinct User Count exceeds Threshold within Interval](https://4264222071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdl9tmJ56lvwg5XY63QYr%2Fuploads%2Fgit-blob-5c3298fb2baf668ba4424a159b4a1b06ed14f9f2%2Fimpact-simple.png?alt=media)

With aggregate intervals:

![Impact — detailed: Aggregate Intervals with Avg 1, Avg 2, Avg 3](https://4264222071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdl9tmJ56lvwg5XY63QYr%2Fuploads%2Fgit-blob-eb06f10a7ee4b11c3dcd75ea9e3f607512ea1c6f%2Fimpact-detailed.png?alt=media)

{% hint style="info" %}
Impact rules require a **User Field** (typically User ID) to determine unique users. You cannot save an Impact rule without specifying this field.
{% endhint %}

### Frequency

> *Identify recurring events over a time interval. It's based on event counts and time intervals. Use this rule type to find recurring problem areas.*

![Rule Type — Frequency selected](https://4264222071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdl9tmJ56lvwg5XY63QYr%2Fuploads%2Fgit-blob-e17982fa6b5b3da271df15b74a0b2b7d3bbdd0b4%2Frule-type-frequency.png?alt=media)

A Frequency rule fires when errors **consistently exceed** the threshold across **all** aggregate intervals within the main interval. Unlike Spike (which looks for a single burst), Frequency detects sustained, recurring patterns.

**Best for:** Consistently failing integrations, recurring batch failures, persistent problems that wouldn't trigger a spike rule.

**How it works:**

![Frequency — recurring events across aggregate intervals](https://4264222071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdl9tmJ56lvwg5XY63QYr%2Fuploads%2Fgit-blob-dae5dc92811660e784e854e11625f5aff49db6dc%2Ffrequency-diagram.png?alt=media)

***

## Creating a Monitoring Rule

Click **Add New Rule** to open the rule form. The right-hand navigation shows all sections of the rule:

### Rule Details

Provide a **Rule Name** and **Description**. Both are required. Use descriptive names so the rule's purpose is clear at a glance.

> Example: *"Send a slack message to devOps channel when more than 10 errors happen in 1 hour"*

### Threshold and Time Interval

![Threshold and Time Interval configuration for a Spike rule](https://4264222071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdl9tmJ56lvwg5XY63QYr%2Fuploads%2Fgit-blob-98e3e5dfddad961ac1f9cee3252c4600495cc0cd%2Fthreshold-time-interval-spike.png?alt=media)

| Field                   | Description                                                                                                                              |
| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| **Threshold Type**      | **Count** — total number of events. **Average** — average count across aggregate intervals.                                              |
| **Comparison Operator** | Greater or equal, Less or equal, etc.                                                                                                    |
| **Value**               | The trigger point (e.g., 10)                                                                                                             |
| **Interval**            | The time window for evaluation. Choose a preset (1 min, 1 hour, 8 hours, 1 day) or select the custom option and enter a value in minutes |
| **Aggregate Interval**  | *(Frequency rules only)* Subdivides the main interval into smaller windows for recurring pattern detection (e.g., 30 min)                |

For Frequency rules, the Aggregate Interval appears as an additional field:

![Threshold and Time Interval for a Frequency rule — includes Aggregate Interval](https://4264222071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdl9tmJ56lvwg5XY63QYr%2Fuploads%2Fgit-blob-04cc582710f06fc6788faf6bc4372e4bc2d1367e%2Fthreshold-time-interval-frequency.png?alt=media)

**Interval guidance:**

* **1 min:** Acute problems — integration outages, something just broke
* **1 hour:** Short-term spikes, rapid response needed
* **8 hours:** Workday duration — ideal for Impact rules ("20+ users in a workday")
* **1 day:** Sustained problems, gradual degradation
* **> 24 hours:** Not recommended — dilutes the value of rapid detection

{% hint style="warning" %}
Monitoring runs on a scheduled cadence that is much faster than batch-based processing. Keep intervals narrow for maximum responsiveness.
{% endhint %}

### Filter Criteria

Narrow which logs the rule evaluates. Without filters, the rule considers all logs.

![Filter Criteria — Category Not equal Flow](https://4264222071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdl9tmJ56lvwg5XY63QYr%2Fuploads%2Fgit-blob-11e8fd70e4941df7f5e3b97e8c6d8b805e878bd2%2Ffilter-criteria.png?alt=media)

Filter criteria works the same as in notification and ticketing rules — select a field, operator, and value. You can add multiple criteria with AND/OR logic.

{% hint style="info" %}
The field list for monitoring filters is slightly different from notification filters. Monitoring uses fields available **immediately upon log creation** (before post-processing enrichment) for maximum speed. Some fields populated by later enrichment are not available here.
{% endhint %}

### Fields Grouping

Grouping buckets logs by a field value before evaluating the threshold. Logs must share the same value for the grouped field(s) to count toward the threshold.

![Fields Grouping — empty section with Add New button](https://4264222071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdl9tmJ56lvwg5XY63QYr%2Fuploads%2Fgit-blob-dbc2e1d0fa78e70b578d99178aaf14b98905cf33%2Ffields-grouping-notifications.png?alt=media)

Think of grouping like SQL `GROUP BY` — each group is evaluated separately.

**Example with Hash 1 (Issue fingerprint):**

![Fields Grouping — grouped by Hash 1](https://4264222071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdl9tmJ56lvwg5XY63QYr%2Fuploads%2Fgit-blob-6edd744a32d9abe7ae62fdbfdeb68657c8f1c8b8%2Ffields-grouping-hash1.png?alt=media)

When grouped by **Hash 1**, the rule only fires if logs from the **same issue** exceed the threshold. This is the most commonly used grouping — it alerts when a specific problem escalates.

**Grouping examples:**

| Group By           | Rule fires when...                                                                                     |
| ------------------ | ------------------------------------------------------------------------------------------------------ |
| **Hash 1** (Issue) | Logs from the *same issue* spike (e.g., 10+ in 1 min) — detects when a single problem is getting worse |
| **Category**       | 10+ logs of the *same category* (e.g., all Apex or all Flow) — but 5 Apex + 6 Flow = no trigger        |
| **Type**           | 10+ logs of the *same type* (e.g., all Screen Flows)                                                   |
| *(no grouping)*    | 10+ total logs regardless of source                                                                    |

### Notifications

When a rule triggers, it creates an **Event** record. Configure notifications to be alerted:

![Notifications section — supports Email, Slack, Jira, MS Teams, and PagerDuty](https://4264222071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdl9tmJ56lvwg5XY63QYr%2Fuploads%2Fgit-blob-dbc2e1d0fa78e70b578d99178aaf14b98905cf33%2Ffields-grouping-notifications.png?alt=media)

Click **Add New** to create a notification, or **Add Existing** to reuse one. You can add multiple notifications of the same or different types.

![Notification form — Slack notification with Event merge fields](https://4264222071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdl9tmJ56lvwg5XY63QYr%2Fuploads%2Fgit-blob-8657c46f7a591eb82ee9e26fe676d4d7dfb83703%2Fnotification-event-slack.png?alt=media)

Monitoring notifications use **Event** merge fields (prefixed with `pharos__Event__c`), not Log or Issue fields. Available fields include:

* `{!pharos__Event__c.Link}` — link to the Event record
* `{!pharos__Event__c.pharos__RecordCount__c}` — number of records in the triggered event
* `{!pharos__Event__c.pharos__Rule_Description__c}` — the rule's description
* `{!pharos__Event__c.pharos__Event_Details__c}` — event details

***

## Understanding Events

When a monitoring rule fires, Pharos creates an **Event** record — a separate object from Logs and Issues. Access events via the Pharos app → **Events** tab (top navigation).

### Event Record

Each Event captures the full context of what triggered the rule:

![Event record — full view with details, occurrence chart, actions, and breakdown charts](https://4264222071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdl9tmJ56lvwg5XY63QYr%2Fuploads%2Fgit-blob-f1f3988584003707fdad4da7777eba220011cc75%2Fevent-record-full.png?alt=media)

### Event Details

The header shows the rule that fired, its criteria, grouped field values, and when it was created:

![Event Details — Criteria, Rule link, Rule Name, Rule Description](https://4264222071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdl9tmJ56lvwg5XY63QYr%2Fuploads%2Fgit-blob-121b5e1346cae85d3f66adebbf30fd8ec6f51fcc%2Fevent-details.png?alt=media)

| Field                       | Description                                                                                                                                                                                                                     |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Criteria**                | The filter criteria that was active on the rule when it fired                                                                                                                                                                   |
| **Grouped Field Values**    | The values that matched the Fields Grouping (if configured)                                                                                                                                                                     |
| **Rule**                    | Link to the monitoring rule record (e.g., R-0000013)                                                                                                                                                                            |
| **Rule Name / Description** | The rule's name and description (e.g., "Error Spike — More than 3 errors in 1 minute"). Displayed live via the Rule lookup—not captured at event creation—so a later rename or description edit is reflected on existing events |

### Event Log Records

The **Event Log Records** tab shows an occurrence chart with the threshold line and the exact moment the rule triggered (**Event time**). You can see the spike that breached the threshold:

![Event Log Records — occurrence chart showing spike exceeding threshold at Event time](https://4264222071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdl9tmJ56lvwg5XY63QYr%2Fuploads%2Fgit-blob-f1f3988584003707fdad4da7777eba220011cc75%2Fevent-record-full.png?alt=media)

### Logs Timing

The **Logs Timing** tab provides a timeline of the individual log records that contributed to the event, with configurable step and range:

![Logs Timing — stacked bar chart of log records over time](https://4264222071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdl9tmJ56lvwg5XY63QYr%2Fuploads%2Fgit-blob-829a963dec2f69681a43fcf42231b134de0655a7%2Fevent-logs-timing.png?alt=media)

### Event Actions

The **Event Actions** panel shows which notifications were delivered when the rule fired:

![Event Actions — PagerDuty and Slack notifications delivered](https://4264222071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdl9tmJ56lvwg5XY63QYr%2Fuploads%2Fgit-blob-e2c6b7af3a661bfda576ce20c4f6d64f789fb797%2Fevent-actions.png?alt=media)

Each action records the **Action Type** (e.g., PagerDuty Notification, Slack Notification), **Delivered to** (channel or service), and **Subject** line.

### Breakdown Charts

The right-hand side of the Event record shows donut charts breaking down the event's log records by **Category** and **Type**:

![Event Log Records by Category and by Type](https://4264222071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdl9tmJ56lvwg5XY63QYr%2Fuploads%2Fgit-blob-09247db370f39bd552b74d3cc30fa5b43cd57d0f%2Fevent-charts.png?alt=media)

These charts give you an immediate visual sense of what kinds of errors contributed to the spike.

***

## Recommended Starting Rules

| Rule                   | Type   | Threshold  | Interval | Grouping            | Notifications     |
| ---------------------- | ------ | ---------- | -------- | ------------------- | ----------------- |
| **Error spike**        | Spike  | Count ≥ 10 | 1 min    | Hash 1 (same issue) | Slack + PagerDuty |
| **User impact spike**  | Impact | Count ≥ 20 | 8 hours  | *(none)*            | Slack             |
| **Integration outage** | Spike  | Count ≥ 10 | 1 min    | Functional Area     | Slack             |

Start with these, run for 2–4 weeks, then refine based on what fires and what doesn't.

{% hint style="success" %}
**Start conservative.** Higher thresholds and longer intervals first — you can always tighten them. Over-sensitive rules cause alert fatigue and get ignored.
{% endhint %}

***

## Troubleshooting

| Issue                           | Cause                                    | Resolution                                                        |
| ------------------------------- | ---------------------------------------- | ----------------------------------------------------------------- |
| Rule never fires                | Threshold too high or interval too short | Lower threshold or lengthen interval; review your org's baseline  |
| Too many events                 | Threshold too low or no filters/grouping | Raise threshold; add filters or grouping by Hash 1                |
| Event fires but no notification | Notification misconfigured               | Verify Slack/Teams connection; check channel ID                   |
| Can't find events               | Looking in the wrong tab                 | Use **Events** tab in the Pharos app (not Logs or Issues)         |
| Can't save Impact rule          | Missing User Field                       | Set the User Field to User ID — this is required for Impact rules |

***

## Related

* [Events](https://docs.pharos.ai/configuration-guide/monitoring/events.md) — Salesforce Event Monitoring add-on
* [Limits](https://docs.pharos.ai/configuration-guide/monitoring/limits.md) — Governor limit monitoring
* [Notification Rules](https://docs.pharos.ai/configuration-guide/notifications.md) — Per-log and per-issue alerting
* [PagerDuty](https://docs.pharos.ai/configuration-guide/integrations/pagerduty.md) — Pair monitoring rules with on-call escalation for critical spikes
