Download the PHP package haythem-bekir/laravel-discord-logger without Composer
On this page you can find all versions of the php package haythem-bekir/laravel-discord-logger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download haythem-bekir/laravel-discord-logger
More information about haythem-bekir/laravel-discord-logger
Files in haythem-bekir/laravel-discord-logger
Package laravel-discord-logger
Short Description Laravel package for sending log notifications to Discord via webhooks with real-time alerts and daily reports
License MIT
Informations about the package laravel-discord-logger
Laravel Discord Logger
A Laravel package that sends daily log statistics reports to Discord. Get comprehensive insights about your application's logs delivered to your Discord channel every day.
Why Daily Reports?
Instead of alert fatigue from real-time notifications, this package provides:
- đ Comprehensive daily statistics - Total logs, breakdown by level and channel
- â ī¸ Top recurring errors - Identify patterns and prioritize fixes
- đ¯ Better signal-to-noise - Review at your chosen time, not during incidents
- đ Zero performance impact - Runs as a scheduled task, not on every request
- đ Historical insights - See trends and patterns over time
Features
- â Daily log statistics report sent to Discord
- â Breakdown by log level (emergency, alert, critical, error, warning, etc.)
- â Breakdown by channel
- â Top 5 recurring errors with count
- â Customizable bot appearance (username, avatar)
- â Environment labels (production, staging, etc.)
- â Manual or scheduled execution
- â Dry-run mode for previewing reports
- â Clean SOLID architecture
- â Fully testable
Requirements
- PHP 8.1+
- Laravel 10.x, 11.x, or 12.x
Installation
Install via Composer:
Publish the configuration file:
Quick Start
1. Get Your Discord Webhook URL
- Go to your Discord server settings
- Navigate to Integrations â Webhooks
- Click New Webhook
- Choose the channel for reports
- Copy the webhook URL
2. Configure Your Environment
Add to your .env file:
3. Schedule the Daily Report
Laravel 11+ (routes/console.php):
Laravel 10 (app/Console/Kernel.php):
Make sure your scheduler is running:
That's it! You'll receive daily reports at 8:00 AM (UTC).
Usage
Manual Execution
Run reports manually anytime:
Programmatic Usage
Use the actions directly in your code:
Configuration
The package provides several customization options in config/discord-logger.php:
Log Viewer Integration
If you have a Laravel Log Viewer package installed, error messages in Discord reports will automatically become clickable links that take you directly to the log viewer!
Supported Log Viewers
- opcodesio/log-viewer - Modern, feature-rich log viewer (Recommended)
- rap2hpoutre/laravel-log-viewer - Simple, lightweight log viewer
How It Works
-
Install any supported log viewer package:
-
Ensure your
APP_URLis configured in.env: - Error messages in Discord will automatically become clickable:
Clicking the error takes you directly to the log viewer with a search query pre-filled, making it easy to investigate issues!
Configuration
You can customize the log viewer integration:
What the Report Includes
Each daily report contains:
- đ Date - Which day the report covers
- đ Total Logs - Total number of log entries
- đ Breakdown by Level - Count for each level with emoji indicators:
- đ¨ Emergency
- đ Alert
- đĨ Critical
- â Error
- â ī¸ Warning
- đ Notice
- âšī¸ Info
- đ Debug
- đ Breakdown by Channel - Count per logging channel
- â ī¸ Top Recurring Errors - Top 5 most frequent error messages
Example Discord Message
đĄ Note: If you have a Log Viewer package installed, the error messages become clickable links!
Testing
Architecture
This package follows SOLID principles and Domain-Driven Design:
This makes the package:
- â Testable - Mock dependencies easily
- â Extensible - Implement custom transports
- â Maintainable - Clear separation of concerns
Changelog
Please see CHANGELOG for more information on what has changed recently.
Upgrading
Please see UPGRADE for upgrade instructions.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Credits
- Haythem Bekir
- Built with Spatie Laravel Package Tools
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-discord-logger with dependencies
illuminate/support Version ^10.0|^11.0|^12.0
illuminate/http Version ^10.0|^11.0|^12.0
spatie/laravel-package-tools Version ^1.11