php-middleware / log-exceptions
Log all exceptions from your middlewares
1.0.1
2017-05-26 17:18 UTC
Requires
- php: ^5.6 || ^7.0
- http-interop/http-middleware: ^0.4.1
- php-middleware/double-pass-compatibility: ^1.0
- psr/http-message: ^1.0
- psr/log: ^1.0
Requires (Dev)
- gamez/psr-testlogger: ^1.0.5
- phpunit/phpunit: ^5.6 || ^6.1.3
- zendframework/zend-diactoros: ^1.1.3
This package is not auto-updated.
Last update: 2024-11-04 16:48:14 UTC
README
Log all exceptions from your middlewares
When your middleware throw exception this middleware catch it, log it and throw again. You will newer miss any exception.
Installation
composer require php-middleware/log-exceptions
To build this middleware you need to injecting inside LogExceptionMiddleware
instance of any Psr\Log\LoggerInterface
implementation:
$logger = new LoggerImplementation(); $middleware = new PhpMiddleware\LogException\LogExceptionMiddleware($logger);
and add it into your middleware dispatcher. You can also setup level of log (default critical, second arg) and message (third arg).