mileschou / monoex
Monolog extensions
Installs: 2 949
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 2
Open Issues: 0
Requires
- php: ^8.1
- ext-json: *
- monolog/monolog: ^3
- psr/http-client: ^1.0
- psr/http-factory: ^1.0
- psr/http-message: ^1.0
- psr/log: ^2.0 || ^3.0
Requires (Dev)
- laminas/laminas-diactoros: ^2.2
- laravel/framework: ^10
- mileschou/psr: ^1.1
- phpunit/phpunit: ^10
- squizlabs/php_codesniffer: ^3.7
Suggests
- laminas/laminas-diactoros: Require ^2 if need use PSR-17 HTTP factory
- symfony/http-client: Require ^4.4 | ^5 if need use PSR-18 HTTP client
README
Monolog extensions.
- Version 0.x Support PHP 7.1 ~ 8.0 and Laravel 5.7 ~ 9.0.
- Version 2.x Support PHP 8.1 and Laravel 10.
Use on Laravel
This package implements Package Discovery, and the following PSR-17 / PSR-18 driver must be register:
Psr\Http\Client\ClientInterface
Psr\Http\Message\RequestFactoryInterface
Psr\Http\Message\StreamFactoryInterface
Example, use laminas/laminas-diactoros
and symfony/http-client
:
$app->singleton(RequestFactoryInterface::class, new \Laminas\Diactoros\RequestFactory()); $app->singleton(ResponseFactoryInterface::class, new \Laminas\Diactoros\ResponseFactory()); $app->singleton(StreamFactoryInterface::class, new \Laminas\Diactoros\StreamFactory()); $app->singleton(ClientInterface::class, function($app) { return new \Symfony\Component\HttpClient\Psr18Client( null, $app->make(ResponseFactoryInterface::class), $app->make(StreamFactoryInterface::class) ); });
Finally, the logging.php
config can use by new driver psr18slack
:
return [ 'channels' => [ 'stack' => [ 'driver' => 'psr18slack', // same as slack driver 'url' => env('LOG_SLACK_WEBHOOK_URL'), 'username' => 'Laravel Log', 'emoji' => ':boom:', 'level' => 'critical', ], ], ];
License
The MIT License (MIT). Please see License File for more information.