Download the PHP package mahmoud-mhamed/laravel-logman without Composer
On this page you can find all versions of the php package mahmoud-mhamed/laravel-logman. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mahmoud-mhamed/laravel-logman
More information about mahmoud-mhamed/laravel-logman
Files in mahmoud-mhamed/laravel-logman
Package laravel-logman
Short Description Automatic error reporting and log management for Laravel applications
License MIT
Informations about the package laravel-logman
Logman
Error reporting & log management for Laravel — automatic exception notifications with a powerful built-in log viewer, mute/throttle controls, and an analysis dashboard.
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
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)
- Browse & Search — full-text search with multi-word AND matching + regex mode
- Level Filtering — emergency, alert, critical, error, warning, notice, info, debug
- Date & 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 & 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
Request Logging
- Log every incoming HTTP request — disabled by default; flip one switch to capture all requests
- Log on demand — call
logman_log_request()(orLogman::logRequest()) anywhere to record a single request - Dedicated log file — written to
logman-requests-*.logand browsable in the Log Viewer automatically - Configurable payload — include/exclude query, body, headers, and response status
- Filter from
.env— restrict by HTTP method, by URL path pattern, or by a substring in the URL - Path exclusions — skip assets, health checks, and third-party routes (Logman's own routes are always excluded)
- Secret-safe — bodies, query params, and headers are masked using the same
hidden_fieldsas notifications
Requirements
- PHP 8.1+
- Laravel 10.x, 11.x, or 12.x
Installation
Laravel auto-discovers the package. Then run the install command:
This will:
- Publish the config file (
config/logman.php) - Create the storage directory (
storage/logman) with.gitignore - Add all required env variables to
.envand.env.example
Use
--forceto overwrite an existing config file with the latest version.
Updating config after a package update
When Logman adds new config options in a new version, you can add them automatically:
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.
| Flag | Description |
|---|---|
--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
1. Pick a channel and configure it (see details below)
2. Test your setup
3. Open the Log Viewer
Navigate to /logman in your browser.
Configuration
Publish the config file:
To overwrite an existing config with the latest defaults:
To add missing config keys after a package update (preserves your existing values):
Publish the views (optional):
General Options
| Option | Default | Description |
|---|---|---|
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
Slack is enabled by default.
Setup:
- Go to https://api.slack.com/apps
- Click Create New App > From scratch
- Give it a name (e.g. "Exception Bot") and select your workspace
- In the left sidebar, click Incoming Webhooks
- Toggle Activate Incoming Webhooks to On
- Click Add New Webhook to Workspace
- Select the channel and click Allow
- Copy the Webhook URL
Add to .env:
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
Setup:
- Open Telegram and search for @BotFather
- Send
/newbotand follow the prompts to create a bot - Copy the Bot Token you receive
- Add the bot to your group/channel
- To get the Chat ID: send a message in the group, then open
https://api.telegram.org/bot<TOKEN>/getUpdatesand find thechat.idvalue
Add to .env:
Enable in config/logman.php:
Channel: Discord
Setup:
- Open your Discord server and go to Server Settings > Integrations
- Click Webhooks > New Webhook
- Choose a name and the channel to post to
- Click Copy Webhook URL
Add to .env:
Enable in config/logman.php:
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:
Enable in config/logman.php:
Multiple recipients: use comma-separated emails in LOGMAN_MAIL_TO.
Per-Channel Options
Every channel supports these options:
| Option | Default | Description |
|---|---|---|
enabled |
varies | Enable/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):
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:
Rate Limiting & Throttling
Logman uses two levels of protection to prevent notification flooding:
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.
| Option | Default | Description |
|---|---|---|
rate_limit.enabled |
true |
Enable global rate limiting |
rate_limit.cooldown_seconds |
10 |
Seconds before the same exception can be re-reported to any channel |
When 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
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.
| Channel | Default | Description |
|---|---|---|
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
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
| Option | Default | Description |
|---|---|---|
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 |
Request Logging
Log every incoming HTTP request to a dedicated log file that shows up in the Log Viewer.
Disabled by default — enable it with the config flag or LOGMAN_REQUEST_LOGGING=true.
| Option | Default | Description |
|---|---|---|
request_logging.enabled |
false |
Master switch for request logging |
request_logging.channel |
'logman_requests' |
Logging channel (auto-created via request_channel_config) |
request_logging.level |
'info' |
Log level for request entries |
request_logging.log_query |
true |
Log query string parameters |
request_logging.log_body |
true |
Log request body (sensitive fields masked) |
request_logging.log_headers |
true |
Log a curated set of request headers |
request_logging.log_response_status |
true |
Include the HTTP response status |
request_logging.log_response_body |
false |
Include the response body (masked; JSON decoded) |
request_logging.middleware |
'global' |
Where to attach: 'global', a group name, or a list of groups |
request_logging.methods |
[] |
Only log these methods (empty = all) — env LOGMAN_REQUEST_METHODS |
request_logging.only |
[] |
Path allowlist — only log paths matching these patterns (* wildcards); env LOGMAN_REQUEST_ONLY |
request_logging.only_containing |
[] |
URL substring allowlist — only log URLs containing these strings; env LOGMAN_REQUEST_ONLY_CONTAINING |
request_logging.except |
asset/vendor patterns | Skip paths matching these patterns (* wildcards) |
request_logging.max_payload_length |
8000 |
Truncate oversized payloads |
Logman's own viewer routes are always excluded, so request logging never logs itself.
Filter which requests get logged, entirely from .env:
only and only_containing are allowlists: when either is set, a request is logged only if it matches at least one entry (the two are combined with OR). Leave both empty to log every request.
Log a request on demand
Want to log a single request from your own code — regardless of the config switches? Call the helper (or the facade) anywhere: it writes to the same logman_requests channel and bypasses the enabled flag and all skip/allowlist filters.
Each manual entry records the file and line it was called from (called_from), shown as a banner at the top of the log's detail view.
Open in your IDE: set LOGMAN_EDITOR and that called_from location becomes a clickable link that jumps straight to the source.
Viewing logs written on a server? Map the remote path to your local checkout in config/logman.php:
Pages
| Route | Description |
|---|---|
/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
Automatic (default)
With auto_report_exceptions enabled (default), every unhandled exception is reported automatically. No code changes needed.
Manual Reporting
Ignoring Exceptions
Uses instanceof — ignoring a parent class also ignores all its subclasses.
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
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
Each notification includes:
| Section | Details |
|---|---|
| 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
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
For production, add authentication middleware and/or an authorize callback:
Custom Channels
Register your own notification channel:
Register it in a service provider:
Then add it to your config:
Artisan Commands
| Command | Description |
|---|---|
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
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)
Enable the daily digest in your config/logman.php — no manual scheduler setup needed:
Logman will automatically register the scheduled command for you.
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:
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:
Options
Testing
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
MIT
All versions of laravel-logman with dependencies
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
illuminate/log Version ^10.0|^11.0|^12.0|^13.0