PHPackages                             mimmi20/monolog-callbackfilterhandler - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. mimmi20/monolog-callbackfilterhandler

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

mimmi20/monolog-callbackfilterhandler
=====================================

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

4.0.2(7mo ago)0589.6k↓21.4%11BSD-3-ClausePHPPHP ~8.3.0 || ~8.4.0 || ~8.5.0CI passing

Since Apr 21Pushed 2mo agoCompare

[ Source](https://github.com/mimmi20/monolog-callbackfilterhandler)[ Packagist](https://packagist.org/packages/mimmi20/monolog-callbackfilterhandler)[ Docs](https://github.com/mimmi20/monolog-callbackfilterhandler)[ RSS](/packages/mimmi20-monolog-callbackfilterhandler/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (17)Versions (20)Used By (1)

CallbackFilterHandler for Monolog
=================================

[](#callbackfilterhandler-for-monolog)

This library is a Fork of [llaville/monolog-callbackfilterhandler](https://github.com/llaville/monolog-callbackfilterhandler) with updates for Monolog 3.

[![Latest Stable Version](https://camo.githubusercontent.com/0ef8f4e0aa124de07b7000289c403ad3c0915cf8b9cd9e7106873f31021c3834/68747470733a2f2f706f7365722e707567782e6f72672f6d696d6d6932302f6d6f6e6f6c6f672d63616c6c6261636b66696c74657268616e646c65722f762f737461626c653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/mimmi20/monolog-callbackfilterhandler)[![Latest Unstable Version](https://camo.githubusercontent.com/8a654e3f4394873812b359b46318bdc5016e2dd2c4f7beb2c76abcad19cda87f/68747470733a2f2f706f7365722e707567782e6f72672f6d696d6d6932302f6d6f6e6f6c6f672d63616c6c6261636b66696c74657268616e646c65722f762f756e737461626c653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/mimmi20/monolog-callbackfilterhandler)[![License](https://camo.githubusercontent.com/926f2208bb1649a5ddd38c0138119c1d027270c1568ce1e5422a05e1fd42c524/68747470733a2f2f706f7365722e707567782e6f72672f6d696d6d6932302f6d6f6e6f6c6f672d63616c6c6261636b66696c74657268616e646c65722f6c6963656e73653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/mimmi20/monolog-callbackfilterhandler)

Code Status
-----------

[](#code-status)

[![codecov](https://camo.githubusercontent.com/f4e242978503d78d6d0c507374636a88e34dcc3f3f56a4009f2756d54b8c91ca/68747470733a2f2f636f6465636f762e696f2f67682f6d696d6d6932302f6d6f6e6f6c6f672d63616c6c6261636b66696c74657268616e646c65722f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/mimmi20/monolog-callbackfilterhandler)[![Test Coverage](https://camo.githubusercontent.com/f6e464fa1f0a701c37b7481083582adc2ccc6839f48ddb0ac90c48e39bf0e205/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f38646562633663353732363334633064356364372f746573745f636f766572616765)](https://codeclimate.com/github/mimmi20/monolog-callbackfilterhandler/test_coverage)[![Average time to resolve an issue](https://camo.githubusercontent.com/d9f9513190798acdb636c947b52bd27912f29bd9921a8e850e93ab55102ba65c/68747470733a2f2f697369746d61696e7461696e65642e636f6d2f62616467652f7265736f6c7574696f6e2f6d696d6d6932302f6d6f6e6f6c6f672d63616c6c6261636b66696c74657268616e646c65722e737667)](https://isitmaintained.com/project/mimmi20/monolog-callbackfilterhandler "Average time to resolve an issue")[![Percentage of issues still open](https://camo.githubusercontent.com/2b084b427ecc0813e652fe4586af754a33795f6f04e3c5040b3b57b78e6f668e/68747470733a2f2f697369746d61696e7461696e65642e636f6d2f62616467652f6f70656e2f6d696d6d6932302f6d6f6e6f6c6f672d63616c6c6261636b66696c74657268616e646c65722e737667)](https://isitmaintained.com/project/mimmi20/monolog-callbackfilterhandler "Percentage of issues still open")[![Mutation testing badge](https://camo.githubusercontent.com/93ef325dcaccbe4cd2aac0a5e6acb7793d22aa0e304494112a005f640aa97a75/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742675726c3d687474707325334125324625324662616467652d6170692e737472796b65722d6d757461746f722e696f2532466769746875622e636f6d2532466d696d6d6932302532466d6f6e6f6c6f672d63616c6c6261636b66696c74657268616e646c65722532466d6173746572)](https://dashboard.stryker-mutator.io/reports/github.com/mimmi20/monolog-callbackfilterhandler/master)[![Maintainability](https://camo.githubusercontent.com/7ca4ec54948700feb5491868967b9e657fd50e59f992580a00fcde6b9a95a20a/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f38646562633663353732363334633064356364372f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/mimmi20/monolog-callbackfilterhandler/maintainability)

Requirements
------------

[](#requirements)

This handler works with PHP 8.1 or above

Installation
------------

[](#installation)

Run

```
composer require mimmi20/monolog-callbackfilterhandler
```

Features
--------

[](#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](https://github.com/Seldaek/monolog/blob/master/src/Monolog/Handler/FilterHandler.php)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
-------

[](#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](https://github.com/mimmi20/monolog-callbackfilterhandler/blob/master/examples/basic.php) file.

License
-------

[](#license)

This package is licensed using the MIT License.

Please have a look at [`LICENSE.md`](LICENSE.md).

###  Health Score

59

—

FairBetter than 99% of packages

Maintenance78

Regular maintenance activity

Popularity35

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity89

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~294 days

Recently: every ~126 days

Total

14

Last Release

220d ago

Major Versions

1.x-dev → 2.0.02021-07-20

2.0.0 → 3.0.02022-11-18

3.0.7 → 4.0.02024-12-03

PHP version history (7 changes)1.0.0PHP &gt;=5.3.0

1.x-devPHP ^5.3|^7.0

2.0.0PHP ^7.2|^8.0

3.0.0PHP ^8.1

3.0.2PHP ^8.1.0

3.0.6PHP ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0

4.0.0PHP ~8.3.0 || ~8.4.0 || ~8.5.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/5fea77dd303122241a6caac15ea7456607bcb6f5db869fc8fc9eaf3ec0630a84?d=identicon)[mimmi20](/maintainers/mimmi20)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (342 commits)")[![mimmi20](https://avatars.githubusercontent.com/u/1120192?v=4)](https://github.com/mimmi20 "mimmi20 (293 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (150 commits)")[![llaville](https://avatars.githubusercontent.com/u/364342?v=4)](https://github.com/llaville "llaville (35 commits)")[![weirdan](https://avatars.githubusercontent.com/u/57403?v=4)](https://github.com/weirdan "weirdan (5 commits)")[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mimmi20-monolog-callbackfilterhandler/health.svg)

```
[![Health](https://phpackages.com/badges/mimmi20-monolog-callbackfilterhandler/health.svg)](https://phpackages.com/packages/mimmi20-monolog-callbackfilterhandler)
```

###  Alternatives

[symfony/monolog-bridge

Provides integration for Monolog with various Symfony components

2.6k189.7M258](/packages/symfony-monolog-bridge)[rollbar/rollbar

Monitors errors and exceptions and reports them to Rollbar

33723.7M82](/packages/rollbar-rollbar)[illuminate/log

The Illuminate Log package.

6224.3M518](/packages/illuminate-log)[honeybadger-io/honeybadger-php

Honeybadger PHP library

381.5M4](/packages/honeybadger-io-honeybadger-php)[graycore/magento2-stdlogging

A Magento 2 module that changes all logging handlers to stdout

2382.6k](/packages/graycore-magento2-stdlogging)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
