https://github.com/datto/php-json-rpc-log
Logged server extension for the JSON-RPC library
https://github.com/datto/php-json-rpc-log
Last synced: about 1 year ago
JSON representation
Logged server extension for the JSON-RPC library
- Host: GitHub
- URL: https://github.com/datto/php-json-rpc-log
- Owner: datto
- License: lgpl-3.0
- Created: 2015-12-14T13:13:08.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-01-26T19:59:15.000Z (over 10 years ago)
- Last Synced: 2025-03-27T18:21:22.871Z (about 1 year ago)
- Language: PHP
- Size: 9.77 KB
- Stars: 1
- Watchers: 4
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
# JSON-RPC Log Extension
This is a logger extension for the [php-json-rpc](https://github.com/datto/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](https://github.com/datto/php-json-rpc-simple)). This will log all requests and the responses to the system's syslog, typically found at `/var/log/syslog`:
```php
reply('{"jsonrpc": "2.0", "method": "math/subtract", "params": [6, 2], "id": 1}');
```
Requirements
------------
* PHP >= 5.3
Installation
------------
```javascript
"require": {
"datto/json-rpc-log": "~4.0"
}
```
License
-------
This package is released under an open-source license: [LGPL-3.0](https://www.gnu.org/licenses/lgpl-3.0.html).
Author
------
Written by [Philipp C. Heckel](https://github.com/binwiederhier).