mimmi20 / monolog-callbackfilterhandler
Monolog handler wrapper that filters records based on a list of callback functions
Installs: 305 328
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 2
Open Issues: 0
Requires
- php: ~8.3.0 || ~8.4.0 || ~8.5.0
- ext-json: *
- monolog/monolog: ^3.8.0
Requires (Dev)
- ext-ctype: *
- ext-dom: *
- ext-mbstring: *
- ext-simplexml: *
- ext-tokenizer: *
- ext-xml: *
- ext-xmlwriter: *
- infection/infection: ^0.29.8
- mimmi20/coding-standard: ^6.0.0
- nikic/php-parser: ^5.3.1
- phpstan/extension-installer: ^1.4.3
- phpstan/phpstan: ^1.12.9
- phpstan/phpstan-deprecation-rules: ^1.2.1
- phpstan/phpstan-phpunit: ^1.4.0
- phpunit/phpunit: ^11.4.4
- psr/log: ^3.0.2
- rector/rector: ^1.2.10
- rector/type-perfect: ^1.0.0
- symfony/process: ^7.2.0
- symplify/phpstan-rules: ^13.0.1
- tomasvotruba/cognitive-complexity: ^0.2.3
- tomasvotruba/type-coverage: ^1.0.0
- tomasvotruba/unused-public: ^1.0.0
README
This library is a Fork of llaville/monolog-callbackfilterhandler with updates for Monolog 3.
Code Status
Requirements
This handler works with PHP 8.1 or above
Installation
Run
composer require mimmi20/monolog-callbackfilterhandler
Features
- This handler obey first to basic Monolog rules as
handler level
andbubble
. - Then, in second time, logs are filtered by rules defined in one or more callback functions.
Main difference with FilterHandler included in standard Monolog distribution since version 1.8.0
FilterHandler
can just filter records and only allow those of a given list of levels through to the wrapped handler.CallbackFilterHandler
may filter records to the wrapped handler, on each standard record elements including extra data and logging context.
Example
Here is a basic setup to log all events to a file and most important to another one (or notify by mail). See examples/basic.php file.
License
This package is licensed using the MIT License.
Please have a look at LICENSE.md
.