PHPackages                             wyrihaximus/psr-3-filter - 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. wyrihaximus/psr-3-filter

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

wyrihaximus/psr-3-filter
========================

PSR-3 log level filter

3.0.0(7mo ago)24.6k[1 issues](https://github.com/WyriHaximus/php-psr-3-filter/issues)[1 PRs](https://github.com/WyriHaximus/php-psr-3-filter/pulls)MITMakefilePHP ^8.4CI failing

Since Jan 11Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/WyriHaximus/php-psr-3-filter)[ Packagist](https://packagist.org/packages/wyrihaximus/psr-3-filter)[ GitHub Sponsors](https://github.com/WyriHaximus)[ RSS](/packages/wyrihaximus-psr-3-filter/feed)WikiDiscussions master Synced yesterday

READMEChangelog (4)Dependencies (4)Versions (13)Used By (0)

[PSR-3](http://www.php-fig.org/psr/psr-3/) Filter decorators
============================================================

[](#psr-3-filter-decorators)

[![Linux Build Status](https://camo.githubusercontent.com/1d81d6e580175b591d8f432aeb570d777380f7ac390f1b0c01f333a7752382ae/68747470733a2f2f7472617669732d63692e6f72672f57797269486178696d75732f7068702d7073722d332d66696c7465722e706e67)](https://travis-ci.org/WyriHaximus/php-psr-3-filter)[![Latest Stable Version](https://camo.githubusercontent.com/19e3fb9e8a9682b96bf51cf3d2fea2c9a6bfdff298227eca2359d0ab7f2b26f5/68747470733a2f2f706f7365722e707567782e6f72672f57797269486178696d75732f7073722d332d66696c7465722f762f737461626c652e706e67)](https://packagist.org/packages/WyriHaximus/psr-3-filter)[![Total Downloads](https://camo.githubusercontent.com/496000c2be69d10511b2c0a578b6c1288fffa2e441bd2e20f0d7d646e249b5f1/68747470733a2f2f706f7365722e707567782e6f72672f57797269486178696d75732f7073722d332d66696c7465722f646f776e6c6f6164732e706e67)](https://packagist.org/packages/WyriHaximus/psr-3-filter/stats)[![Code Coverage](https://camo.githubusercontent.com/1bf3b57aba810fbfc6ab09cc4c8e8448d5f32f59516d66ac751b04e4338d67c5/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f57797269486178696d75732f7068702d7073722d332d66696c7465722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/WyriHaximus/php-psr-3-filter/?branch=master)[![License](https://camo.githubusercontent.com/d85221b898fd65f258bac7d87f84aea938ad04a02da258661077f03e97d78edc/68747470733a2f2f706f7365722e707567782e6f72672f57797269486178696d75732f7073722d332d66696c7465722f6c6963656e73652e706e67)](https://packagist.org/packages/wyrihaximus/psr-3-filter)

### Installation

[](#installation)

To install via [Composer](http://getcomposer.org/), use the command below, it will automatically detect the latest version and bind it with `^`.

```
composer require wyrihaximus/psr-3-filter

```

Context Filter
--------------

[](#context-filter)

```
$level2 = ['bad', 'evil'];
$monolog = new Monolog(); // Any PSR-3 logger
$filterredLogger = new ContextFilterLogger('level1.level2', $level2, $monolog);
$filterredLogger->info('bad', [
    'level1' => [
        'level2' => 'bad',
    ],
]); // Will reach monolog
$filterredLogger->info('good', [
    'level1' => [
        'level2' => 'good',
    ],
]); // Won't reach monolog
$filterredLogger->info('evil', [
    'level1' => [
        'level2' => 'evil',
    ],
]); // Will reach monolog
```

Log Level Filter
----------------

[](#log-level-filter)

```
$monolog = new Monolog(); // Any PSR-3 logger
$filterredLogger = new LogLevelFilterLogger(['error'], $monolog);
$filterredLogger->error('bad'); // Won't reach monolog
$filterredLogger->info('good'); // Will reach monolog
$filterredLogger->error('evil'); // Won't reach monolog
```

Message Keyword Filter
----------------------

[](#message-keyword-filter)

```
$keywords = ['bad', 'evil'];
$monolog = new Monolog(); // Any PSR-3 logger
$filterredLogger = new MessageKeywordFilterLogger($keywords, $monolog);
$filterredLogger->info('bad'); // Won't reach monolog
$filterredLogger->info('good'); // Will reach monolog
$filterredLogger->info('evil'); // Won't reach monolog
```

Context Logger Prefix Filter
----------------------------

[](#context-logger-prefix-filter)

Chops off everything before the last '\] ', intended to be used with [`wyrihaximus/psr-3-context-logger`](https://github.com/WyriHaximus/php-psr-3-context-logger).

```
$monolog = new Monolog(); // Any PSR-3 logger
$filterredLogger = new ContextLoggerPrefixFilterLogger($monolog);
$filterredLogger->info('bad', '[HttpServer] [Request] something gone wrong'); // Will reach monolog as: something gone wrong
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

License
-------

[](#license)

Copyright 2025 [Cees-Jan Kiewiet](https://wyrihaximus.net/)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance70

Regular maintenance activity

Popularity20

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity88

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 60.7% of commits — single point of failure

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 ~943 days

Total

4

Last Release

212d ago

Major Versions

1.1.0 → 2.0.02022-01-08

2.0.0 → 3.0.02025-10-13

PHP version history (3 changes)1.0.0PHP ^7.0

2.0.0PHP ^8.0

3.0.0PHP ^8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/147145?v=4)[Cees-Jan Kiewiet](/maintainers/WyriHaximus)[@WyriHaximus](https://github.com/WyriHaximus)

---

Top Contributors

[![WyriHaximus](https://avatars.githubusercontent.com/u/147145?v=4)](https://github.com/WyriHaximus "WyriHaximus (37 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (9 commits)")[![dependabot-support](https://avatars.githubusercontent.com/u/112581971?v=4)](https://github.com/dependabot-support "dependabot-support (7 commits)")[![renovate-runner[bot]](https://avatars.githubusercontent.com/u/147145?v=4)](https://github.com/renovate-runner[bot] "renovate-runner[bot] (6 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (2 commits)")

---

Tags

hacktoberfestpsr-3

### Embed Badge

![Health badge](/badges/wyrihaximus-psr-3-filter/health.svg)

```
[![Health](https://phpackages.com/badges/wyrihaximus-psr-3-filter/health.svg)](https://phpackages.com/packages/wyrihaximus-psr-3-filter)
```

###  Alternatives

[sentry/sentry

PHP SDK for Sentry (http://sentry.io)

1.9k227.1M273](/packages/sentry-sentry)[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)[open-telemetry/sdk

SDK for OpenTelemetry PHP.

2222.9M248](/packages/open-telemetry-sdk)[open-telemetry/api

API for OpenTelemetry PHP.

1833.0M214](/packages/open-telemetry-api)[pagemachine/typo3-formlog

Form log for TYPO3

23225.3k6](/packages/pagemachine-typo3-formlog)

PHPackages © 2026

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