承接 websoftwares/monolog-zmq-handler 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

websoftwares/monolog-zmq-handler

最新稳定版本:0.2.2

Composer 安装命令:

composer require websoftwares/monolog-zmq-handler

包简介

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

README 文档

README

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

Build Status Scrutinizer Code Quality Code Coverage Dependencies Status

##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.

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

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

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

  • v0.2.0: Allowing multiple \ZMQ::MODE_* options thx for @reenl pointing this out.
  • v0.1.0: Initial

Testing

In the tests folder u can find several tests.

Acknowledgement

The logging package Monolog developers.

License

The MIT License (MIT).

统计信息

  • 总下载量: 12.39k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 6
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-09-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固