PHPackages                             mahmoud-mhamed/laravel-logman - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. mahmoud-mhamed/laravel-logman

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

mahmoud-mhamed/laravel-logman
=============================

Automatic error reporting and log management for Laravel applications

v1.0.8(1mo ago)0789↓70.4%MITBladePHP ^8.1

Since Apr 13Pushed 1mo agoCompare

[ Source](https://github.com/mahmoud-mhamed/laravel-logman)[ Packagist](https://packagist.org/packages/mahmoud-mhamed/laravel-logman)[ RSS](/packages/mahmoud-mhamed-laravel-logman/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (7)Dependencies (4)Versions (10)Used By (0)

 [![PHP 8.1+](https://camo.githubusercontent.com/1c50423dbfb36d5424aaa4ffb4705f52ae63207697389e07e9e96ad076a776b8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312b2d3838393242463f7374796c653d666c61742d737175617265266c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://camo.githubusercontent.com/1c50423dbfb36d5424aaa4ffb4705f52ae63207697389e07e9e96ad076a776b8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312b2d3838393242463f7374796c653d666c61742d737175617265266c6f676f3d706870266c6f676f436f6c6f723d7768697465) [![Laravel](https://camo.githubusercontent.com/1a98c0882406e80b16b10fdcf92952596d1d10d6abf4cc98bb33989a12dc0ee4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d31302e782532307c25323031312e782532307c25323031322e782d4646324432303f7374796c653d666c61742d737175617265266c6f676f3d6c61726176656c266c6f676f436f6c6f723d7768697465)](https://camo.githubusercontent.com/1a98c0882406e80b16b10fdcf92952596d1d10d6abf4cc98bb33989a12dc0ee4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d31302e782532307c25323031312e782532307c25323031322e782d4646324432303f7374796c653d666c61742d737175617265266c6f676f3d6c61726176656c266c6f676f436f6c6f723d7768697465) [![MIT License](https://camo.githubusercontent.com/152aa2a37725b9fd554b28ff24d270f6071c67927a63e6d635a55c8e188e20c7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e3f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/152aa2a37725b9fd554b28ff24d270f6071c67927a63e6d635a55c8e188e20c7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e3f7374796c653d666c61742d737175617265)

Logman
======

[](#logman)

**Error reporting &amp; log management for Laravel** — automatic exception notifications with a powerful built-in log viewer, mute/throttle controls, and an analysis dashboard.

---

What it does
------------

[](#what-it-does)

When an unhandled exception occurs in your Laravel app, Logman captures everything — the stack trace, the request, the authenticated user, recent database queries, queue job details — and sends a rich, formatted notification to your configured channel. All of this happens automatically, with zero code changes.

On top of that, Logman ships with a **full-featured log viewer** you can access from your browser to browse, search, filter, mute, throttle, and review your Laravel log files.

---

Features
--------

[](#features)

### Notifications

[](#notifications)

- **Multi-Channel** — send to Slack, Telegram, Discord, Email — or all at once
- **Automatic Exception Reporting** — every unhandled exception, reported with full context
- **Rich Error Details** — stack trace, request info, auth user, DB queries, job context, environment
- **Custom Channels** — register your own notification driver with one line
- **Queue Support** — send notifications asynchronously via Laravel queues
- **Retry Logic** — configurable retry attempts per channel on failure
- **Log Level per Channel** — each channel can filter by minimum severity (e.g. Mail = critical only)
- **Per-Channel Throttle** — independent cooldown per channel per exception
- **Rate Limiting** — prevents the same exception from flooding your channels (global cooldown)
- **Mute System** — temporarily silence specific exceptions
- **Throttle System** — limit how many times an exception is reported per time period

### Log Viewer (`/logman`)

[](#log-viewer-logman)

- **Browse &amp; Search** — full-text search with multi-word AND matching + regex mode
- **Level Filtering** — emergency, alert, critical, error, warning, notice, info, debug
- **Date &amp; Time Filtering** — filter by date range and time range
- **Analysis Dashboard** — charts, statistics, per-file breakdowns, today's summary
- **Review System** — mark entries as reviewed / in-progress / won't-fix with notes
- **Mute &amp; Throttle from UI** — mute or throttle any error directly from the log viewer
- **Stack Trace Viewer** — expandable details with tabs (Stack Trace, Context, Raw)
- **In-Detail Search** — search within stack traces with match navigation (prev/next)
- **File Management** — download, clear, delete, batch-delete log files
- **Grouped Errors** — deduplicated view of recurring errors with counts
- **Export** — download filtered logs as CSV or JSON
- **Bookmarks** — save log entries for later reference
- **Config Viewer** — view all package settings from the web UI
- **About Page** — quick overview of features, channels, commands
- **Dark Mode** — full dark/light theme with localStorage persistence
- **Zero Dependencies** — no external CSS/JS frameworks, pure standalone UI
- **Responsive** — works on desktop and mobile

---

Requirements
------------

[](#requirements)

- PHP 8.1+
- Laravel 10.x, 11.x, or 12.x

---

Installation
------------

[](#installation)

```
composer require mahmoud-mhamed/laravel-logman
```

Laravel auto-discovers the package. Then run the install command:

```
php artisan logman:install
```

This will:

- Publish the config file (`config/logman.php`)
- Create the storage directory (`storage/logman`) with `.gitignore`
- Add all required env variables to `.env` and `.env.example`

> Use `--force` to overwrite an existing config file with the latest version.

#### Updating config after a package update

[](#updating-config-after-a-package-update)

When Logman adds new config options in a new version, you can add them automatically:

```
php artisan logman:install --sync
```

This will compare your `config/logman.php` with the package default and **insert any missing keys** — with their default values, comments, and original formatting preserved. Your existing values stay untouched.

FlagDescription`--force`Overwrite the entire config file with the latest package default`--sync`Add missing config keys with their defaults (preserves your existing values and formatting)---

Quick Start
-----------

[](#quick-start)

### 1. Pick a channel and configure it (see details below)

[](#1-pick-a-channel-and-configure-it-see-details-below)

### 2. Test your setup

[](#2-test-your-setup)

```
php artisan logman:test
```

### 3. Open the Log Viewer

[](#3-open-the-log-viewer)

Navigate to `/logman` in your browser.

---

Configuration
-------------

[](#configuration)

Publish the config file:

```
php artisan vendor:publish --tag=logman-config
```

To overwrite an existing config with the latest defaults:

```
php artisan vendor:publish --tag=logman-config --force
```

To add missing config keys after a package update (preserves your existing values):

```
php artisan logman:install --sync
```

Publish the views (optional):

```
php artisan vendor:publish --tag=logman-views
```

### General Options

[](#general-options)

OptionDefaultDescription`enable_production``true`Send reports in production`enable_local``false`Send reports in local environment`auto_report_exceptions``true`Auto-register in exception handler`ignore``[]`Exception classes to skip (uses `instanceof`)`storage_path``storage/logman`Directory for mutes, throttles, rate limits data### Channel: Slack

[](#channel-slack)

Slack is **enabled by default**.

**Setup:**

1. Go to
2. Click **Create New App** &gt; **From scratch**
3. Give it a name (e.g. "Exception Bot") and select your workspace
4. In the left sidebar, click **Incoming Webhooks**
5. Toggle **Activate Incoming Webhooks** to **On**
6. Click **Add New Webhook to Workspace**
7. Select the channel and click **Allow**
8. Copy the **Webhook URL**

**Add to `.env`:**

```
LOG_SLACK_WEBHOOK_URL=https://hooks.slack.com/services/T.../B.../xxxx
```

If your app doesn't already define a `slack` logging channel, Logman creates one automatically using `slack_channel_config` in the config file.

---

### Channel: Telegram

[](#channel-telegram)

**Setup:**

1. Open Telegram and search for **@BotFather**
2. Send `/newbot` and follow the prompts to create a bot
3. Copy the **Bot Token** you receive
4. Add the bot to your group/channel
5. To get the **Chat ID**: send a message in the group, then open `https://api.telegram.org/bot/getUpdates` and find the `chat.id` value

**Add to `.env`:**

```
LOGMAN_TELEGRAM_BOT_TOKEN=123456789:ABCdefGHIjklMNOpqrsTUVwxyz
LOGMAN_TELEGRAM_CHAT_ID=-100123456789
```

**Enable in `config/logman.php`:**

```
'telegram' => [
    'enabled' => true,
    ...
],
```

---

### Channel: Discord

[](#channel-discord)

**Setup:**

1. Open your Discord server and go to **Server Settings** &gt; **Integrations**
2. Click **Webhooks** &gt; **New Webhook**
3. Choose a name and the channel to post to
4. Click **Copy Webhook URL**

**Add to `.env`:**

```
LOGMAN_DISCORD_WEBHOOK=https://discord.com/api/webhooks/1234567890/abcdef...
```

**Enable in `config/logman.php`:**

```
'discord' => [
    'enabled' => true,
    ...
],
```

---

### Channel: Mail

[](#channel-mail)

Sends exception reports via email using Laravel's built-in mail system. Make sure your app's mail config (`config/mail.php`) is working first.

**Add to `.env`:**

```
LOGMAN_MAIL_TO=alerts@example.com,team@example.com
```

**Enable in `config/logman.php`:**

```
'mail' => [
    'enabled' => true,
    ...
],
```

Multiple recipients: use comma-separated emails in `LOGMAN_MAIL_TO`.

---

### Per-Channel Options

[](#per-channel-options)

Every channel supports these options:

OptionDefaultDescription`enabled`variesEnable/disable the channel`auto_report_exceptions``true`Auto-report exceptions (false = manual send only)`daily_digest``true`Include this channel in the daily digest`min_level``'debug'`Minimum log level (see levels below)`queue``false`Send notifications asynchronously via Laravel queues`retries``0`Number of retry attempts on failure`throttle``0`Per-channel cooldown in seconds (0 = no per-channel throttle)**Available log levels** (from lowest to highest severity):

```
debug → info → notice → warning → error → critical → alert → emergency

```

Setting `min_level` to `error` means only `error`, `critical`, `alert`, and `emergency` will be reported to that channel. Setting it to `debug` reports everything.

Example — Slack gets everything sync, Mail only gets critical errors async:

```
'slack' => ['enabled' => true, 'min_level' => 'debug', 'queue' => false, 'throttle' => 0],
'mail'  => ['enabled' => true, 'min_level' => 'critical', 'queue' => true, 'retries' => 1, 'throttle' => 60],
```

---

### Rate Limiting &amp; Throttling

[](#rate-limiting--throttling)

Logman uses **two levels** of protection to prevent notification flooding:

#### Level 1: Global Rate Limit

[](#level-1-global-rate-limit)

Runs **first**, before any channel is contacted. If the same exception (same class + file + line) fires again within the cooldown window, it is blocked for **all channels** at once. This is the fast, cheap check that prevents unnecessary work.

OptionDefaultDescription`rate_limit.enabled``true`Enable global rate limiting`rate_limit.cooldown_seconds``10`Seconds before the same exception can be re-reported to any channelWhen an error is re-sent after being rate-limited, the notification includes:

> This error was suppressed 5 time(s) since last report (rate limited).

#### Level 2: Per-Channel Throttle

[](#level-2-per-channel-throttle)

Runs **second**, independently for each channel. This lets you set different cooldowns per channel — for example, send to Slack every second but limit emails to once per minute.

ChannelDefaultDescription`channels.slack.throttle``1`Slack cooldown in seconds`channels.telegram.throttle``10`Telegram cooldown in seconds`channels.discord.throttle``10`Discord cooldown in seconds`channels.mail.throttle``60`Mail cooldown in seconds#### How They Work Together

[](#how-they-work-together)

```
Exception occurs
  → Global Rate Limit (blocked? → stop for ALL channels)
  → Per-Channel Throttle (blocked? → skip THIS channel only)
  → Send notification

```

Both checks are lightweight (file read / cache lookup) and **much faster** than the actual HTTP request or email send they prevent. Keeping both levels gives you coarse global protection plus fine-grained per-channel control.

### Log Viewer Options

[](#log-viewer-options)

OptionDefaultDescription`log_viewer.enabled``true`Enable/disable log viewer routes`log_viewer.route_prefix``'logman'`URL prefix`log_viewer.middleware``['web']`Route middleware`log_viewer.storage_path``storage/logs`Log files directory`log_viewer.pattern``'*.log'`File glob pattern`log_viewer.max_file_size``50 MB`Max file size to display`log_viewer.per_page``25`Entries per page`log_viewer.per_page_options``[15,25,50,100]`Available per-page options---

Pages
-----

[](#pages)

RouteDescription`/logman`Browse, search, and filter log files`/logman/analysis`Charts, statistics, today vs yesterday comparison`/logman/mutes`Manage muted exceptions`/logman/throttles`Manage throttled exceptions`/logman/grouped`Deduplicated view of recurring errors`/logman/bookmarks`Saved log entries`/logman/config`View all package configuration`/logman/about`Package info, features, commands---

Usage
-----

[](#usage)

### Automatic (default)

[](#automatic-default)

With `auto_report_exceptions` enabled (default), every unhandled exception is reported automatically. No code changes needed.

### Manual Reporting

[](#manual-reporting)

```
use MahmoudMhamed\Logman\Facades\Logman;

// Report an exception manually
try {
    // risky operation...
} catch (\Throwable $e) {
    Logman::logException($e);
}

// Send an info message to all enabled channels
Logman::sendInfo('Deployment completed successfully');
```

### Ignoring Exceptions

[](#ignoring-exceptions)

```
// config/logman.php
'ignore' => [
    \Symfony\Component\HttpKernel\Exception\NotFoundHttpException::class,
    \Illuminate\Auth\AuthenticationException::class,
    \Illuminate\Database\Eloquent\ModelNotFoundException::class,
],
```

Uses `instanceof` — ignoring a parent class also ignores all its subclasses.

---

Mute System
-----------

[](#mute-system)

Temporarily silence specific exceptions from being reported. Available from the **log viewer UI** or the **Mutes page**.

- **Exception Class** — fully qualified class name or partial match
- **Message Pattern** — optional partial message match
- **Duration** — 1h, 6h, 12h, 1d, 3d, 1w, 1m
- **Reason** — optional note for context
- **Hit Counter** — tracks how many times the mute blocked a notification
- **Extend** — extend active mutes without removing them

---

Throttle System
---------------

[](#throttle-system)

Limit how many times an exception is reported per time period.

Example: allow max **5 reports per hour** for a specific exception — after that, further occurrences are silently suppressed until the period resets.

---

What Gets Reported
------------------

[](#what-gets-reported)

Each notification includes:

SectionDetails**Exception**Class, message, file, line, code, previous exception**Auth**User name, ID, email, guard**Request**Method, URL, path, IP, host, route, action, duration, headers, query params, body, files**CLI**Command (for console exceptions)**Job**Job name, queue, connection, attempts**Queries**Last 5 database queries with execution time**Environment**PHP version, Laravel version, memory peak, hostname, git commit, app URL**Trace**Stack trace (first 2000 characters)---

Performance
-----------

[](#performance)

Logman has **zero impact** on normal requests (no exceptions). When an exception occurs:

- **In-memory caching** — JSON data files are read at most once per request
- **Deferred writes** — state changes are batched and written once at request termination
- **Singleton services** — instantiated once per application lifecycle
- **Early returns** — empty checks skip all processing

---

Security
--------

[](#security)

For production, add authentication middleware and/or an authorize callback:

```
// config/logman.php
'log_viewer' => [
    'middleware' => ['web', 'auth'],
    'authorize' => fn ($request) => $request->user()?->isAdmin(),
],
```

---

Custom Channels
---------------

[](#custom-channels)

Register your own notification channel:

```
use MahmoudMhamed\Logman\Channels\ChannelInterface;

class PagerDutyChannel implements ChannelInterface
{
    public function sendException(array $payload): void { /* ... */ }
    public function sendInfo(string $message, array $context): void { /* ... */ }
}
```

Register it in a service provider:

```
use MahmoudMhamed\Logman\LogmanService;

LogmanService::registerDriver('pagerduty', PagerDutyChannel::class);
```

Then add it to your config:

```
'channels' => [
    'pagerduty' => [
        'enabled' => true,
        'driver' => \App\Channels\PagerDutyChannel::class,
    ],
],
```

---

Artisan Commands
----------------

[](#artisan-commands)

CommandDescription`logman:install`Publish config, create storage directory, add env variables`logman:install --force`Overwrite existing config with the package default`logman:install --sync`Add missing config keys while preserving existing values and formatting`logman:test`Send a test notification to all enabled channels`logman:mute "ClassName" --duration=1d`Mute an exception from CLI`logman:list-mutes`List all active mutes`logman:clear-mutes`Remove all active mutes`logman:digest`Send a daily digest summary to all enabled channels`logman:digest --date=2026-04-12`Digest for a specific date`logman:digest --channel=slack`Send digest to a specific channel only---

Daily Digest
------------

[](#daily-digest)

Logman can send a daily summary of all log activity to your enabled channels (Slack, Telegram, Discord, Mail). The digest includes:

- Total entries and error count
- Breakdown by log level (emergency, error, warning, info, etc.)
- Top 5 most frequent errors
- Per-file entry counts

### Automatic Setup (Recommended)

[](#automatic-setup-recommended)

Enable the daily digest in your `config/logman.php` — no manual scheduler setup needed:

```
'daily_digest' => [
    'enabled' => true,
    'time'    => '09:00',  // 24h format, server timezone
],
```

Logman will automatically register the scheduled command for you.

### Per-Channel Control

[](#per-channel-control)

Each channel has its own `daily_digest` flag. A channel can receive real-time exception reports but skip the digest, or vice versa:

```
'slack'    => ['enabled' => true,  'daily_digest' => true],   // gets the digest
'telegram' => ['enabled' => true,  'daily_digest' => false],  // no digest
'mail'     => ['enabled' => true,  'daily_digest' => true],   // gets the digest
```

### Manual Setup (Alternative)

[](#manual-setup-alternative)

If you prefer manual control, you can skip the config flag and schedule it yourself in `routes/console.php` or `app/Console/Kernel.php`:

```
// Laravel 11+
Schedule::command('logman:digest')->dailyAt('09:00');

// Laravel 10 and below (in Kernel.php)
$schedule->command('logman:digest')->dailyAt('09:00');
```

### Options

[](#options)

```
# Send digest for yesterday (default)
php artisan logman:digest

# Send digest for a specific date
php artisan logman:digest --date=2026-04-12

# Send to a specific channel only (bypasses per-channel daily_digest flag)
php artisan logman:digest --channel=slack
```

---

Testing
-------

[](#testing)

```
composer install
vendor/bin/phpunit
```

Tests cover:

- MuteService (mute, unmute, throttle, rate limiting)
- LogmanService (exception reporting, custom drivers, ignored exceptions)
- All routes (index, dashboard, mutes, throttles, grouped, bookmarks, config, about)

---

License
-------

[](#license)

MIT

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance92

Actively maintained with recent releases

Popularity19

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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.

###  Release Activity

Cadence

Every ~2 days

Total

9

Last Release

38d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3d00c2f8ae29401e1b578e1435eae2629802a0c10e8322e5cb12d701538ff971?d=identicon)[mahmoud-mhamed](/maintainers/mahmoud-mhamed)

---

Top Contributors

[![mahmoud-mhamed](https://avatars.githubusercontent.com/u/45818696?v=4)](https://github.com/mahmoud-mhamed "mahmoud-mhamed (22 commits)")

---

Tags

laravelloggingmonitoringerrorsexceptions

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mahmoud-mhamed-laravel-logman/health.svg)

```
[![Health](https://phpackages.com/badges/mahmoud-mhamed-laravel-logman/health.svg)](https://phpackages.com/packages/mahmoud-mhamed-laravel-logman)
```

###  Alternatives

[bugsnag/bugsnag-laravel

Official Bugsnag notifier for Laravel applications.

90335.7M37](/packages/bugsnag-bugsnag-laravel)[honeybadger-io/honeybadger-laravel

Honeybadger Laravel integration

431.3M](/packages/honeybadger-io-honeybadger-laravel)[rollbar/rollbar-laravel

Rollbar error monitoring integration for Laravel projects

14110.7M10](/packages/rollbar-rollbar-laravel)[shaffe/laravel-mail-log-channel

A package to support logging via email in Laravel

1392.4k](/packages/shaffe-laravel-mail-log-channel)

PHPackages © 2026

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