everon / logger-redis
Logger plugin with Redis handler for EveronLogger
3.0.0
2023-08-04 13:39 UTC
Requires
- php: ^8.1
- ext-redis: *
- everon/logger: ^3
- predis/predis: ^1.1
Requires (Dev)
- ext-json: *
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^10
- popo/generator: ^6
- symfony/var-dumper: ^5|^6
This package is auto-updated.
Last update: 2024-12-04 16:55:16 UTC
README
A plugin with Redis handler for EveronLogger.
Configuration
-
Configurator
Everon\Shared\LoggerRedis\Configurator\Plugin\RedisLoggerPluginConfigurator
-
Redis Connection Configurator
Everon\Shared\LoggerRedis\Configurator\Plugin\RedisConnectionConfigurator
-
Default Options
'pluginClass' => \Everon\LoggerRedis\Plugin\Redis\RedisLoggerPlugin::class, 'pluginFactoryClass' => null, 'logLevel' => \Monolog\Level::Debug, 'shouldBubble' => true, 'key' => null, 'capSize' => 0, 'redisConnection' => \Everon\Shared\LoggerRedis\Configurator\Plugin\RedisConnectionConfigurator,
-
Default Options for
RedisConnectionConfigurator
'host' => null, 'port' => 6379, 'timeout' => 0.0, 'password' => null, 'persistentId' => null, 'retryInterval' => 0, 'readTimeout' => 0.0,
-
Plugin
Everon\LoggerRedis\Plugin\Redis\RedisLoggerPlugin
-
Usage
use Everon\Shared\Logger\Configurator\Plugin\LoggerConfigurator; use Everon\Shared\LoggerRedis\Configurator\Plugin\RedisLoggerPluginConfigurator; use Everon\Logger\EveronLoggerFacade; $redisPluginConfigurator = (new RedisLoggerPluginConfigurator()) ->setLogLevel(\Monolog\Level::Info) ->setKey('foo-bar-queue'); $redisPluginConfigurator->requireRedisConnection() ->setPersistentId('persistent-connection') ->setHost('redis.host') ->setReadTimeout(0.5) ->setRetryInterval(3) ->setTimeout(10); $configurator = (new LoggerConfigurator) ->setName('everon-logger-example') ->add($redisPluginConfigurator); $logger = (new EveronLoggerFacade)->buildLogger($configurator); $logger->info('lorem ipsum');
Requirements
- PHP v8.1.x
- Monolog v3.x
Installation
composer require everon/logger-redis