PHPackages                             tmf/logfilter - 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. [CLI &amp; Console](/categories/cli)
4. /
5. tmf/logfilter

ActiveLibrary[CLI &amp; Console](/categories/cli)

tmf/logfilter
=============

a cli app for filtering web server access logs

04PHP

Since Mar 23Pushed 11y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (3)Used By (0)

LogFilter: a extensible log processor
=====================================

[](#logfilter-a-extensible-log-processor)

Logfilter is PHP CLI application which consumes log entries from a web server's access log. Each log entry is then processed in a filter chain implemented with the Symfony EventDispatcher component, where you can add your own filter's with a container service definition (config.yml). The idea is that log entries can be passed along the filter chain (or withheld). Each filter (an EventListener) can also influence the propagation of the logentries or dispatch new events (like banning a host).

Usage
-----

[](#usage)

1. Configure the filter chain with config.yml: declare your EventListener's as Services, order by inverse with priority parameter in the tag. ```yaml` tmf.logfilter.endpoint: class: Tmf\\LogFilter\\Filter\\EndPointFilter arguments: endpoints: - "\\/endpoint" tags: - { priority: 10, name: kernel.event\_listener, event: logfilter.process, method: onProcess }

    tmf.logfilter.requestabuse: class: Tmf\\LogFilter\\Filter\\RequestAbuseFilter arguments: window: 5 maxHits: 3 eventDispatcher: @event\_dispatcher tags: - { priority: 9, name: kernel.event\_listener, event: logfilter.process, method: onProcess } - { name: kernel.event\_listener, event: logfilter.report, method: onReport } - { name: kernel.event\_listener, event: logfilter.ban\_host, method: onBanHost }

    tmf.logfilter.getparameter: class: Tmf\\LogFilter\\Filter\\GetParameterCounter arguments: getParameter: "param" tags: - { priority: 8, name: kernel.event\_listener, event: logfilter.process, method: onProcess } - { name: kernel.event\_listener, event: logfilter.report, method: onReport } - { name: kernel.event\_listener, event: logfilter.ban\_host, method: onBanHost }

    ```

    ```
2. Run the logfilter with

    ```
    ./bin/logfilter -c config.yml access.log
    ```

Extend
------

[](#extend)

You can tie in your own filters (like a UserAgent filter, or a Datacenter IP-Block filter). EventListeners will receive a LogEntriesEvent event, whenever a 'logfilter.process' or 'logfilter.ban\_host' event is dispatched. The LogEntriesEvent can have one or multiple LogEntry objects (multiple: when log entries are withheld)

Todo
----

[](#todo)

- use console output for reports
- cleanup

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/216cd4bf21dbff1de4f4a7f2992123132d4cc21f265831ef69bdbc1f5228035e?d=identicon)[tmf](/maintainers/tmf)

---

Top Contributors

[![tmf](https://avatars.githubusercontent.com/u/1573003?v=4)](https://github.com/tmf "tmf (12 commits)")

### Embed Badge

![Health badge](/badges/tmf-logfilter/health.svg)

```
[![Health](https://phpackages.com/badges/tmf-logfilter/health.svg)](https://phpackages.com/packages/tmf-logfilter)
```

###  Alternatives

[wp-cli/wp-cli

WP-CLI framework

5.1k17.2M320](/packages/wp-cli-wp-cli)[consolidation/annotated-command

Initialize Symfony Console commands from annotated command class methods.

22569.8M19](/packages/consolidation-annotated-command)[seld/cli-prompt

Allows you to prompt for user input on the command line, and optionally hide the characters they type

24725.8M17](/packages/seld-cli-prompt)[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[php-tui/php-tui

Comprehensive TUI library heavily influenced by Ratatui

589747.0k6](/packages/php-tui-php-tui)[codedungeon/php-cli-colors

Liven up you PHP Console Apps with standard colors

10210.1M26](/packages/codedungeon-php-cli-colors)

PHPackages © 2026

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