vube/monolog-splunk-formatter
最新稳定版本:1.0.1
Composer 安装命令:
composer require vube/monolog-splunk-formatter
包简介
Splunk Line Formatter for Monolog
README 文档
README
A Splunk Formatter for Monolog
About
vube/monolog-splunk-formatter is a formatter for use with Monolog.
It augments the Monolog LineFormatter
by adding Splunk-optimized handling of associative array contexts.
Prerequisites/Requirements
- PHP 5.3.0 or greater
- Composer
Installation
Installation is possible using Composer
composer require vube/monolog-splunk-formatter ~1.0
Usage
Create an instance of \Vube\Monolog\Formatter\SplunkLineFormatter
and set it as the formatter for the \Monolog\Handler\StreamHandler
that you use with your \Monolog\Logger instance.
use \Monolog\Logger;
use \Monolog\Handler\StreamHandler;
use \Vube\Monolog\Formatter\SplunkLineFormatter;
$log = new Logger('DEMO');
$handler = new StreamHandler('php://stdout', Logger::WARNING);
$handler->setFormatter(new SplunkLineFormatter());
$log->pushHandler($handler);
$log->addError('Bad stuff happened', array('detail1' => 'something', 'detail2' => 'otherthing'));
Unit Testing
vube/monolog-splunk-formatter ships with unit tests using PHPUnit.
-
If PHPUnit is installed globally run
phpunitto run the tests. -
If PHPUnit is not installed globally, install it locally through composer by running
composer install --dev. Run the tests themselves by callingvendor/bin/phpunit.
Unit tests are also automatically run on Travis CI
License
vube/monolog-splunk-formatter is released under the MIT public license. See the enclosed LICENSE for details.
Thanks
Thanks to Bramus for contributing a Monolog formatter, I was inspired by and reused some of his work.
统计信息
- 总下载量: 464.09k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-02-17