mimmi20 / monolog-callbackfilterhandler
Monolog handler wrapper that filters records based on a list of callback functions
Installs: 285 318
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 2
Open Issues: 0
Requires
- php: ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0
- ext-json: *
- ext-mbstring: *
- monolog/monolog: ^3.7.0
Requires (Dev)
- ext-ctype: *
- ext-dom: *
- ext-simplexml: *
- ext-tokenizer: *
- ext-xml: *
- ext-xmlwriter: *
- infection/infection: ^0.27.11 || ^0.28.1
- mimmi20/coding-standard: ^5.2.43
- nikic/php-parser: ^4.19.1 || ^5.0.2
- phpstan/extension-installer: ^1.4.3
- phpstan/phpstan: ^1.12.3
- phpstan/phpstan-deprecation-rules: ^1.2.1
- phpstan/phpstan-phpunit: ^1.4.0
- phpunit/phpunit: ^10.5.25
- psr/log: ^3.0.0
- rector/rector: ^1.2.5
- rector/type-perfect: ^0.2.0
- symplify/phpstan-rules: ^13.0.1
- tomasvotruba/cognitive-complexity: ^0.2.3
- tomasvotruba/type-coverage: ^0.3.1
- tomasvotruba/unused-public: ^0.3.11
This package is auto-updated.
Last update: 2024-11-13 03:11:35 UTC
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
.