https://github.com/php-middleware/log-exceptions
Log all exceptions from your middlewares
https://github.com/php-middleware/log-exceptions
Last synced: 16 days ago
JSON representation
Log all exceptions from your middlewares
- Host: GitHub
- URL: https://github.com/php-middleware/log-exceptions
- Owner: php-middleware
- License: mit
- Created: 2017-05-26T15:29:47.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2021-04-28T21:54:59.000Z (about 5 years ago)
- Last Synced: 2025-08-15T13:23:02.611Z (10 months ago)
- Language: PHP
- Size: 5.86 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# log-exceptions [](https://travis-ci.org/php-middleware/log-exceptions)
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:
```php
$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).