PHPackages                             websoftwares/monolog-zmq-handler - 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. websoftwares/monolog-zmq-handler

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

websoftwares/monolog-zmq-handler
================================

Sends your logs over a ZeroMQ (ØMQ) socket.

0.2.2(11y ago)612.4k[1 issues](https://github.com/websoftwares/MonologZMQHandler/issues)MITPHPPHP &gt;=5.4.0

Since Sep 13Pushed 11y ago1 watchersCompare

[ Source](https://github.com/websoftwares/MonologZMQHandler)[ Packagist](https://packagist.org/packages/websoftwares/monolog-zmq-handler)[ RSS](/packages/websoftwares-monolog-zmq-handler/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (12)Used By (0)

\#MonologZMQHandler (v0.2.2) This package lets u send your Monolog logs over a ZeroMQ (ØMQ) socket.

[![Build Status](https://camo.githubusercontent.com/ed6d537a1a0350c5d19e89c9cb793a357102a42fd97e1f5e92eb89243a121435/68747470733a2f2f6170692e7472617669732d63692e6f72672f776562736f667477617265732f4d6f6e6f6c6f675a4d5148616e646c65722e706e67)](https://travis-ci.org/websoftwares/MonologZMQHandler)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/7c4bca5d31b7e6f7fc621d235fdfd57eb99c7365c4a44e83922e518f8309f441/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f776562736f667477617265732f4d6f6e6f6c6f675a4d5148616e646c65722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/websoftwares/MonologZMQHandler/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/a2dc8fac99680e0c1fdfe72805fbe60b04ae514aeadb2f6c58fc96fc3b97ab6f/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f776562736f667477617265732f4d6f6e6f6c6f675a4d5148616e646c65722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/websoftwares/yo/?branch=master)[![Dependencies Status](https://camo.githubusercontent.com/e277ec0fcc2396fe155aafe30a7e8469eed80e4e9c278cefee95e2d9d323ac19/68747470733a2f2f646570656e64696e672e696e2f776562736f667477617265732f4d6f6e6f6c6f675a4d5148616e646c65722e706e67)](http://depending.in/websoftwares/MonologZMQHandler)

\##System requirements ZeroMQ library needs to be available on your system on Ubuntu easily install with APT package manager:

```
sudo apt-get install libzmq3 libzmq3-dev

```

The PHP ZeroMQ extension is required follow the installation from the zeromq [guide](http://zeromq.org/bindings:php).

Installing via Composer (recommended)
-------------------------------------

[](#installing-via-composer-recommended)

Install composer in your project:

```
curl -s http://getcomposer.org/installer | php

```

Create a composer.json file in your project root:

```
{
    "require": {
		"websoftwares/monolog-zmq-handler": ~2.0"
    }
}
```

Install via composer

```
php composer.phar install

```

Usage
-----

[](#usage)

Basic usage of the `ZMQHandler` class.

```
use Websoftwares\Monolog\Handler\ZMQHandler;
use Monolog\Logger;

// Create ZeroMQ PUB socket
$context = new \ZMQContext();
$publisher = new \ZMQSocket($context, ZMQ::SOCKET_PUB);
$publisher->bind("tcp://*:5556");

// Create new handler class instance
// First argument is an instance of \ZMQSocket type PUSH OR PUB
// Second argument \ZMQ::MODE_*
// Thirth argument set to true wil make the first message the log channel. (multipart)
// Default operation is \ZMQ::MODE_DONTWAIT
$handler = new ZMQHandler($publisher, \ZMQ::MODE_SNDMORE, true);

// Create new logger instance
$log = new Logger('channelName');
$log->pushHandler($handler);

// Log something
$log->addWarning("Something is going wrong...");
```

Examples
--------

[](#examples)

in the examples/ folder u can find some basic examples for PUB/SUB and PUSH/PULL

PUB/SUB

```
php publisher.php
php subscriber.php

```

PUSH/PULL

```
php pusher.php
php puller.php

```

Changelog
---------

[](#changelog)

- v0.2.0: Allowing multiple \\ZMQ::MODE\_\* options thx for @reenl pointing this out.
- v0.1.0: Initial

Testing
-------

[](#testing)

In the tests folder u can find several tests.

Acknowledgement
---------------

[](#acknowledgement)

The logging package [Monolog](https://github.com/Seldaek/monolog) developers.

License
-------

[](#license)

The [MIT](http://opensource.org/licenses/MIT "MIT") License (MIT).

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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.

###  Release Activity

Cadence

Every ~0 days

Total

11

Last Release

4257d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b876616b4c499f67211e285aed4b04f5ac44f436b553353389a951b2f60e6397?d=identicon)[Websoftwares](/maintainers/Websoftwares)

---

Top Contributors

[![websoftwares](https://avatars.githubusercontent.com/u/946561?v=4)](https://github.com/websoftwares "websoftwares (6 commits)")

---

Tags

handlermonologzeromqzmq

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/websoftwares-monolog-zmq-handler/health.svg)

```
[![Health](https://phpackages.com/badges/websoftwares-monolog-zmq-handler/health.svg)](https://phpackages.com/packages/websoftwares-monolog-zmq-handler)
```

###  Alternatives

[logtail/monolog-logtail

Logtail handler for Monolog

233.2M3](/packages/logtail-monolog-logtail)

PHPackages © 2026

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