joy2fun / laravel-log-pub
Logging to Redis channel for Laravel.
Installs: 288
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/joy2fun/laravel-log-pub
Requires (Dev)
- laravel/laravel: ^5.6
- mockery/mockery: ^1.2
- phpunit/phpunit: ^7.4
This package is auto-updated.
Last update: 2025-12-12 00:28:08 UTC
README
Installation
composer require joy2fun/laravel-log-pub
Configuration
Add a custom logger channel to config/logging.php :
'pub' => [
'driver' => 'custom',
'via' => \Joy2fun\RedisPubLogger\Logger::class
],
Logging to configured channel:
Log::channel("pub")->debug("dummy");
Subscribe Redis channel
php artisan redis:subscribe
More options
[
// ...
'pub' => [
'driver' => 'custom',
'via' => \Joy2fun\RedisPubLogger\Logger::class,
'with' => [
'connection' => 'default', // redis connection
'quiet' => false, // "true" to ignore redis connection exception. default is "false"
'max_trace_length' => 1024, // truncated stacktrace string. set it to "0" to exclude trace from log
'format' => "[%datetime%] %channel%.%level_name%: %message% %context% %extra%\n",
]
]
]