> 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/platform-overview/pharos-platform-architecture/monitoring/log-monitoring.md).

# Log Monitoring

Understand log-based monitoring functionality and how it fits in the overall log lifecycle.

Log monitoring in Pharos operates at a different level than issue-based alerting. While issues provide a rolled-up view of related errors, monitoring analyzes the raw log stream to detect anomalies and patterns that might not be obvious when looking at individual issues alone.

## How Log Monitoring Works

The monitoring system continuously evaluates your log records against configured rules. Unlike notifications that trigger when an issue is created or updated, monitoring rules operate directly on logs as they're generated, analyzing them in near real-time to detect concerning patterns.

This log-level analysis is crucial because it can identify problems that span multiple issues or catch spikes before the issue fingerprinting has had a chance to consolidate related errors. When monitoring detects that something has crossed a configured threshold, it creates a monitored event record that captures the relevant context.

## The Log Lifecycle and Monitoring

Understanding where monitoring fits in the log lifecycle helps clarify its role:

Logs are captured when errors occur in your org—flows fail, Apex throws exceptions, batch jobs encounter problems. These logs contain detailed information about what went wrong, including stack traces, running users, affected records, and error messages. The system immediately begins analyzing these logs for fingerprinting (to create or update issues) and simultaneously evaluates them against active monitoring rules.

If monitoring rules detect a pattern worthy of attention—perhaps error counts have spiked, or user impact has suddenly increased—an event is created. This event aggregates the logs that triggered the rule and provides visualization of what happened. The event can then trigger notifications or create tickets, bringing the right people into the response process.

{% hint style="info" %}
**Log Focus vs. Issue Focus** Monitoring evaluates logs, not issues. This means a monitoring event might encompass logs from multiple different issues if they all occurred during the evaluation window. This cross-issue perspective is one of monitoring's key strengths.
{% endhint %}

## Monitoring in Different Environments

The role of log monitoring varies depending on the environment. In production, monitoring serves as your primary incident detection mechanism, alerting you to problems that need immediate attention. The thresholds are typically set higher to avoid noise from routine errors, focusing instead on genuine anomalies.

In UAT or development environments, monitoring can serve a different purpose—validating that your testing hasn't introduced unexpected error patterns or ensuring that known issues haven't worsened. Some organizations set up more sensitive monitoring in pre-production environments specifically to catch problems before they reach end users.

## From Detection to Response

When a monitoring event is created, it represents just the beginning of the incident response workflow. The event provides visibility into what happened and when, but the next step involves examining the issues underlying those logs to determine if priority reassessment is needed.

A monitoring event might reveal that an issue previously triaged as low priority is now causing significant impact. This is where the monitoring system feeds back into your issue management process—the event data helps you make informed decisions about what needs urgent attention versus what can wait.

{% hint style="warning" %}
**Monitoring Requires Baseline Knowledge** Effective monitoring thresholds come from understanding your org's normal behavior. Setting up monitoring rules too early, before you have baseline data, often results in either too many false positives or thresholds set so high that real problems go undetected.
{% endhint %}

## Continuous Evaluation

Unlike retention rules that run on a schedule or notification rules that fire once per qualifying event, monitoring rules continuously evaluate incoming logs. This real-time analysis means you can detect problems with granularity down to the minute level, enabling rapid response when issues emerge.

The continuous nature of monitoring also means it can detect both sudden spikes (everything was fine, then suddenly many errors occurred) and gradual increases (error frequency has been climbing over the past hour). This temporal awareness is difficult to achieve through manual review of issues or periodic reporting.

***

## In This Section

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>📋 Monitoring Rules</strong></td><td>Monitoring rule nuances, including field grouping and spike/user impact rules.</td><td><a href="https://docs.pharos.ai/platform-overview/pharos-platform-architecture/monitoring/log-monitoring/monitoring-rules.md">Monitoring Rules</a></td></tr><tr><td><strong>📄 Event Records</strong></td><td>The data presented at the event record level, and when records are created.</td><td><a href="https://docs.pharos.ai/platform-overview/pharos-platform-architecture/monitoring/log-monitoring/event-records.md">Event Records</a></td></tr></tbody></table>
