microcode / filament-log-hub
Filament plugin to collect Laravel logs, browse them in admin, and notify messengers
Requires
- php: ^8.3
- filament/filament: ^4.0|^5.0
- illuminate/contracts: ^12.0|^13.0
- illuminate/support: ^12.0|^13.0
- livewire/livewire: ^3.0|^4.0
- microcode/filament-integrations: ^1.1
- monolog/monolog: ^3.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- laravel/pint: ^1.18
- orchestra/testbench: ^10.0|^11.0
- phpunit/phpunit: ^11.0|^12.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-08-25 20:07:49 UTC
README
Collect Laravel/Monolog logs into the database, browse them in a Filament panel, and send alerts through microcode/filament-integrations messengers (Telegram, Viber, WhatsApp).
Requirements
- PHP 8.3+
- Laravel 12 / 13
- Filament 4 / 5
microcode/filament-integrations^1.1
Installation
composer require microcode/filament-log-hub php artisan migrate
This also installs microcode/filament-integrations. Register Integrations (credentials) and Log Hub on the Filament panel. If you skip Integrations, Log Hub registers it automatically:
use Microcode\FilamentIntegrations\IntegrationsPlugin; use Microcode\FilamentLogHub\FilamentLogHubPlugin; ->plugin( IntegrationsPlugin::make() ->navigationGroup('Settings') ->only(['telegram', 'viber', 'whatsapp']) ) ->plugin( FilamentLogHubPlugin::make() ->authorize(fn (): bool => auth()->user()?->isSuperAdmin() ?? false) ->navigationGroup('Settings') ->navigationSort(40) )
Register Integrations before Log Hub if you want a custom only() / except() list.
Ensure the default log stack includes the log-hub channel (enabled automatically when LOG_HUB_TAP_STACK=true), or add it manually:
LOG_STACK=single,log-hub
Telegram / messengers
- Configure the bot/API credentials on the Integrations page (or
services.telegram.bot_token/.env). - Set destination chat IDs / @channels / phone numbers in Log Hub Settings.
LOG_HUB_TELEGRAM_BOT_TOKEN is still copied into services.telegram.bot_token when that config key is empty.
Configuration
| Env | Description |
|---|---|
LOG_HUB_ENABLED |
Master switch |
LOG_HUB_LEVELS |
Comma-separated levels to store (default warning,error,critical,alert,emergency) |
LOG_HUB_NOTIFY_LEVELS |
Levels that trigger messengers |
LOG_HUB_NOTIFY_DRIVERS |
Driver keys (default telegram; also viber, whatsapp) |
LOG_HUB_TELEGRAM_BOT_TOKEN |
Optional fallback Telegram token if Integrations is empty |
LOG_HUB_TELEGRAM_CHAT_IDS |
Default Telegram chat IDs / @channels |
LOG_HUB_VIBER_RECIPIENTS |
Default Viber user IDs |
LOG_HUB_WHATSAPP_RECIPIENTS |
Default WhatsApp phone numbers |
LOG_HUB_QUEUE |
Queue for alert jobs |
LOG_HUB_RETENTION_DAYS |
Auto-purge age; 0 disables |
LOG_HUB_TAP_STACK |
Append log-hub to the default stack |
Runtime overrides (levels, channels, drivers, retention, messenger recipients) can also be changed from the Log Hub Settings action on the Log Hub page.
Purge old rows:
php artisan log-hub:purge php artisan log-hub:purge --days=14
Custom messenger drivers
use Microcode\FilamentLogHub\Contracts\MessengerDriver; use Microcode\FilamentLogHub\Models\LogEntry; use Microcode\FilamentLogHub\Support\MessengerManager; app(MessengerManager::class)->extend('discord', function (): MessengerDriver { return new class implements MessengerDriver { public function key(): string { return 'discord'; } public function isConfigured(): bool { return filled(config('services.discord.webhook_url')); } public function send(LogEntry $entry): void { // send webhook... } }; });
Then enable discord in settings or LOG_HUB_NOTIFY_DRIVERS.
License
MIT