PHPackages                             jenner/log-monitor - 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. jenner/log-monitor

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

jenner/log-monitor
==================

monitoring and alerting of error log

0.2(10y ago)11202MITPHPPHP &gt;=5.3.0

Since Oct 17Pushed 9y ago1 watchersCompare

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

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

log-monitor
===========

[](#log-monitor)

[![Join the chat at https://gitter.im/huyanping/log-monitor](https://camo.githubusercontent.com/6e843a4e6476e583240f1bf7f7145790f88d6472f1293f90efb717e3b83d7a40/68747470733a2f2f6261646765732e6769747465722e696d2f687579616e70696e672f6c6f672d6d6f6e69746f722e737667)](https://gitter.im/huyanping/log-monitor?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)[![Latest Stable Version](https://camo.githubusercontent.com/c88e3cde9c7a25a36889f61e8c35ab18fff9c35feb008c48dd616afa486d211a/68747470733a2f2f706f7365722e707567782e6f72672f6a656e6e65722f6c6f672d6d6f6e69746f722f762f737461626c65)](https://packagist.org/packages/jenner/log-monitor)[![Total Downloads](https://camo.githubusercontent.com/f6e3cd595576eb0e0555c0cc130c2bb065b3fafaab840a17611b915c88e28226/68747470733a2f2f706f7365722e707567782e6f72672f6a656e6e65722f6c6f672d6d6f6e69746f722f646f776e6c6f616473)](https://packagist.org/packages/jenner/log-monitor)[![Latest Unstable Version](https://camo.githubusercontent.com/36445866b43483e18a051822ccec32402eac1f77b09806c8f403ff781f66ee43/68747470733a2f2f706f7365722e707567782e6f72672f6a656e6e65722f6c6f672d6d6f6e69746f722f762f756e737461626c65)](https://packagist.org/packages/jenner/log-monitor)[![License](https://camo.githubusercontent.com/69449539facc8091b850b816ea9b2936beb294420381fa01449b88ad2e4f47f5/68747470733a2f2f706f7365722e707567782e6f72672f6a656e6e65722f6c6f672d6d6f6e69746f722f6c6963656e7365)](https://packagist.org/packages/jenner/log-monitor)[![travis](https://camo.githubusercontent.com/e113a70feff82394d7c418e76cbbcaf5476e88786075ec39869e548cd1959b32/68747470733a2f2f7472617669732d63692e6f72672f687579616e70696e672f6c6f672d6d6f6e69746f722e737667)](https://travis-ci.org/huyanping/log-monitor)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/45fd38443975961e33a92de51d0d521ceedc662f8e2c6dec4977a0fba7fa2f35/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f687579616e70696e672f6c6f672d6d6f6e69746f722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/huyanping/log-monitor/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/61f66c5966764a7605ce319cef451652d0e94fac2a077fa3dbf9eed40ecda7f6/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f687579616e70696e672f6c6f672d6d6f6e69746f722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/huyanping/log-monitor/?branch=master)

An active log monitor based on the `tail` command.

Why use log-monitor?
--------------------

[](#why-use-log-monitor)

Sometimes we want to know what is happening when crontab task is running or what errors had been written into the php error log by php script, and we want to know quickly. log-monitor can help you to monitor the log and notify the users who want to know.

What can log-monitor do?
------------------------

[](#what-can-log-monitor-do)

- monitor the log by the tail command
- notify users when there is an error
- custom log filter interface, which will check the log is error or not
- custom notification interface, which will notify the users
- custom reader interface, if you do not want to use the tail command

How to use log-monitor?
-----------------------

[](#how-to-use-log-monitor)

talk is cheap, show you the code:

```
$reader = new \Jenner\LogMonitor\Reader\Reader('/var/log/messages');
$filter = new Jenner\LogMonitor\Filter\MatchFilter("exception");
$notify = new \Jenner\LogMonitor\Notification\EchoNotification();

$process = new \Jenner\LogMonitor\MonitorTask($reader, $filter, $notify);
$process->run();
$process->wait();
```

There are three interfaces:`AbstractReader`, `NotificationInterface`, `FilterInterface`.
If you want to read log for somewhere else, you can create a class which extends `AbstractReader`.
If you want to filter your log in different way, you can create a class which implements `FilterInterface`.
If you want to send message to somewhere else, you can create a class which implements `NotificationInterface`.

How it works?
-------------

[](#how-it-works)

When you have created a MonitorTask object and call the `run` method, it will start a sub process and call the `tail` command in the sub process. Then it will read from the pipe and check the log by filter that if it is error or not. If there is an error, it will call the notification to notify the users who want to know. Just do not forget to call `wait` method to wait the sub process.

If you have many logs to monitor, you can use the Monitor to manage them. show you the code:

```
$reader = new \Jenner\LogMonitor\Reader\Reader('/var/log/messages');
$filter = new Jenner\LogMonitor\Filter\MatchFilter("exception");
$notify = new \Jenner\LogMonitor\Notification\EchoNotification();

$task = new \Jenner\LogMonitor\MonitorTask($reader, $filter, $notify);
$monitor = new \Jenner\LogMonitor\Monitor();
$monitor->addTask($task);
$monitor->start();
```

Just remember that when you call the `start` method, do not forget to call `wait` method.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.5% 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 ~104 days

Total

2

Last Release

3763d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8d132b55d12cd603f8cce9c152999e2b3f98748d56fe8a21adf62d5830d88d87?d=identicon)[huyanping](/maintainers/huyanping)

---

Top Contributors

[![white-poto](https://avatars.githubusercontent.com/u/4362540?v=4)](https://github.com/white-poto "white-poto (67 commits)")[![gitter-badger](https://avatars.githubusercontent.com/u/8518239?v=4)](https://github.com/gitter-badger "gitter-badger (1 commits)")

---

Tags

monitorlog-monitor

### Embed Badge

![Health badge](/badges/jenner-log-monitor/health.svg)

```
[![Health](https://phpackages.com/badges/jenner-log-monitor/health.svg)](https://phpackages.com/packages/jenner-log-monitor)
```

###  Alternatives

[liip/monitor-bundle

Liip Monitor Bundle

4728.7M16](/packages/liip-monitor-bundle)[analog/analog

Fast, flexible, easy PSR-3-compatible PHP logging package with dozens of handlers.

3451.5M24](/packages/analog-analog)[liuggio/statsd-client-bundle

Provides a statsd client and simple ready-to-use support for #Symfony2 Application

164730.7k](/packages/liuggio-statsd-client-bundle)[guanguans/laravel-exception-notify

Monitor exception and report to the notification channels(Log、Mail、AnPush、Bark、Chanify、DingTalk、Discord、Gitter、GoogleChat、IGot、Lark、Mattermost、MicrosoftTeams、NowPush、Ntfy、Push、Pushback、PushBullet、PushDeer、PushMe、Pushover、PushPlus、QQ、RocketChat、ServerChan、ShowdocPush、SimplePush、Slack、Telegram、WeWork、WPush、XiZhi、YiFengChuanHua、ZohoCliq、ZohoCliqWebHook、Zulip).

14642.7k1](/packages/guanguans-laravel-exception-notify)[putyourlightson/craft-sherlock

Security scanner and monitor to keep your site and CMS secure.

1657.0k2](/packages/putyourlightson-craft-sherlock)[rigor789/airbrake-laravel

Laravel package for the Airbrake API, which supports Errbit

1636.5k](/packages/rigor789-airbrake-laravel)

PHPackages © 2026

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