mimmi20 / monolog-callbackfilterhandler
Monolog handler wrapper that filters records based on a list of callback functions
Installs: 580 430
Dependents: 2
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 3
Open Issues: 0
pkg:composer/mimmi20/monolog-callbackfilterhandler
Requires
- php: ~8.3.0 || ~8.4.0 || ~8.5.0
- ext-json: *
- monolog/monolog: ^3.9.0
Requires (Dev)
- ext-ctype: *
- ext-dom: *
- ext-mbstring: *
- ext-simplexml: *
- ext-tokenizer: *
- ext-xml: *
- ext-xmlwriter: *
- infection/infection: ^0.31.2
- mimmi20/coding-standard: ^6.2.5
- nikic/php-parser: ^5.6.1
- phpstan/extension-installer: ^1.4.3
- phpstan/phpstan: ^2.1.30
- phpstan/phpstan-deprecation-rules: ^2.0.3
- phpunit/phpunit: ^12.4.0
- psr/log: ^3.0.2
- rector/rector: ^2.1.7
- rector/type-perfect: ^2.1.0
- shipmonk/composer-dependency-analyser: ^1.8.3
- symfony/process: ^7.3.4
- symplify/phpstan-rules: ^14.7.0
- tomasvotruba/cognitive-complexity: ^1.0.0
- tomasvotruba/type-coverage: ^2.0.2
- tomasvotruba/unused-public: ^2.0.1
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 levelandbubble.
- 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
- FilterHandlercan just filter records and only allow those of a given list of levels through to the wrapped handler.
- CallbackFilterHandlermay 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.