datto/json-rpc-log 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

datto/json-rpc-log

最新稳定版本:4.0.0

Composer 安装命令:

composer require datto/json-rpc-log

包简介

Logged server extension for JSON-RPC library

README 文档

README

This is a logger extension for the php-json-rpc library. It provides a simple logging mechanism to log incoming JSON-RPC requests and the corresponding responses to a logger.

Examples

To use the logged server, simply create a logger with a corresponding handler and pass it to a Logger\Server instance. In this example, we'll use Monolog's SyslogHandler and the Simple\Evaluator (see php-json-rpc-simple). This will log all requests and the responses to the system's syslog, typically found at /var/log/syslog:

<?php

use Datto\JsonRpc\Logged;
use Datto\JsonRpc\Simple;
use Monolog\Handler\SyslogHandler;
use Monolog\Logger;

$server = new Logged\Server(
    new Simple\Evaluator(),
    new Logger('API', array(new SyslogHandler('datto.api')))
);

$server->reply('{"jsonrpc": "2.0", "method": "math/subtract", "params": [6, 2], "id": 1}');

Requirements

  • PHP >= 5.3

Installation

"require": {
  "datto/json-rpc-log": "~4.0"
}

License

This package is released under an open-source license: LGPL-3.0.

Author

Written by Philipp C. Heckel.

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 3
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-3.0
  • 更新时间: 2015-12-15