PHPackages                             gauravharsh/module-log-monitor - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. gauravharsh/module-log-monitor

Active

gauravharsh/module-log-monitor
==============================

002PHP

Pushed 1mo agoCompare

[ Source](https://github.com/gauravharsh15/magento-2-logs-monitor)[ Packagist](https://packagist.org/packages/gauravharsh/module-log-monitor)[ RSS](/packages/gauravharsh-module-log-monitor/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersionsUsed By (0)

Gaurav Log Monitor for Magento 2
================================

[](#gaurav-log-monitor-for-magento-2)

A professional-grade, high-performance monitoring engine that transforms chaotic `var/log` files into a clean, actionable health dashboard for Adobe Commerce.

📖 Why This Module?
------------------

[](#-why-this-module)

In most Magento environments, log files are a "dark hole." They grow to gigabytes, are rarely checked until a site crashes, and contain thousands of repetitive lines that bury the actual root cause of issues.

**Gaurav\_LogMonitor** was built to solve this by providing:

- **Proactive Health Checks:** Identifies "Silent Killers" like failed background data syncs (ERP/CRM) that don't crash the frontend.
- **Operational Efficiency:** Stops senior developers from wasting hours "log hunting" through massive text files.
- **Server Stability:** Scans 10GB+ logs using near-zero RAM, ensuring the monitoring tool never becomes a bottleneck.

---

🖥️ Preview &amp; UI
-------------------

[](#️-preview--ui)

### 1. Unified Error Dashboard

[](#1-unified-error-dashboard)

[![Admin Dashboard Grid](docs/dashboard.png)](docs/dashboard.png)*A consolidated, searchable view of all unique errors across every .log file in your system. This grid groups thousands of identical errors into single, manageable records.*

### 2. Smart Alert Configuration

[](#2-smart-alert-configuration)

[![Module Configuration Settings](docs/config.png)](docs/config.png)*Easily manage your monitoring settings, define custom email recipients, and set alert thresholds.*

---

⚙️ Configuration &amp; Navigation
---------------------------------

[](#️-configuration--navigation)

After installation, you can manage the module and view alerts via the following paths:

### Admin Dashboard (The Grid)

[](#admin-dashboard-the-grid)

Navigate to: **System &gt; Log Monitor Alerts***This is the central command center where you view, filter, and mass-delete deduplicated error logs.*

### System Configuration

[](#system-configuration)

Navigate to: **Stores &gt; Configuration &gt; Gaurav Extensions &gt; Log Monitor**Here you can configure:

- **Enable/Disable:** Master switch for the background scanner.
- **Recipient Emails:** List of developers to receive hourly summaries.
- **Alert Threshold:** Minimum occurrences required before an email is triggered.
- **Ignore List:** Define specific log files (like `debug.log`) to be skipped.

---

🏗️ Technical Architecture &amp; Logic Flow
------------------------------------------

[](#️-technical-architecture--logic-flow)

The module follows a highly optimized, four-stage lifecycle:

### 1. High-Performance Scanning Engine

[](#1-high-performance-scanning-engine)

Standard log viewers crash servers by loading entire files into memory. This engine uses **Byte-Offset Tracking**:

- **State Tracking:** Records the exact byte position (`last_byte_offset`) where the last scan ended.
- **Efficient Seek:** Uses PHP’s `fseek()` to jump directly to that byte, reading only **newly appended data**.

### 2. Intelligent Deduplication

[](#2-intelligent-deduplication)

Every log line is normalized before storage:

- **Normalization:** Strips timestamps and dynamic variables (IDs, hashes) from log lines.
- **MD5 Hashing:** Generates a unique hash of the core error string.
- **Consolidation:** Matches existing hashes to increment the **occurrence\_count** rather than creating duplicates.

### 3. Automated Cron Lifecycle

[](#3-automated-cron-lifecycle)

- **`logmonitor_process` (Every 5 Mins):** The "Watcher" that scans files and populates the dashboard.
- **`logmonitor_send_alerts` (Every Hour):** The "Messenger" that batches new critical errors into a single HTML email.

---

🛠️ Installation &amp; Setup
---------------------------

[](#️-installation--setup)

```
composer require gauravharsh/module-log-monitor
bin/magento module:enable Gaurav_LogMonitor
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:flush
```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance60

Regular maintenance activity

Popularity2

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity8

Early-stage or recently created project

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/8842b2b72052bd3b34c732ce665cf8897bc7c05c4986442b9849b6ccbbd934db?d=identicon)[gauravharsh15](/maintainers/gauravharsh15)

### Embed Badge

![Health badge](/badges/gauravharsh-module-log-monitor/health.svg)

```
[![Health](https://phpackages.com/badges/gauravharsh-module-log-monitor/health.svg)](https://phpackages.com/packages/gauravharsh-module-log-monitor)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
