mimmi20/monolog-callbackfilterhandler

Monolog handler wrapper that filters records based on a list of callback functions

Maintainers

πŸ‘ mimmi20

Package info

github.com/mimmi20/monolog-callbackfilterhandler

pkg:composer/mimmi20/monolog-callbackfilterhandler

Statistics

Installs: 600 469

Dependents: 2

Suggesters: 0

Stars: 0

Open Issues: 0

4.0.3 2026-05-20 15:22 UTC

Requires

Suggests

None

Provides

None

Conflicts

None

Replaces

None

BSD-3-Clause 78711c3610806280ef95f8b03cdfe2446df93819


README

This library is a Fork of llaville/monolog-callbackfilterhandler with updates for Monolog 3.

πŸ‘ Latest Stable Version
πŸ‘ Latest Unstable Version
πŸ‘ License

Code Status

πŸ‘ codecov
πŸ‘ Test Coverage
πŸ‘ Average time to resolve an issue
πŸ‘ Percentage of issues still open
πŸ‘ Mutation testing badge
πŸ‘ Maintainability

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 and bubble.
  • 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.