定制 marco-introini/monolog-splunk-formatter 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

marco-introini/monolog-splunk-formatter

最新稳定版本:v1.1.0

Composer 安装命令:

composer require marco-introini/monolog-splunk-formatter

包简介

Splunk Line Formatter for Monolog

README 文档

README

Installation

Installation is possible using Composer

composer require marco-introini/monolog-splunk-formatter

Usage

  • create an instance of \Mintdev\Monolog\Formatter\SplunkLineFormatter
  • set it as the formatter for the \Monolog\Handler\StreamHandler

If you want to use log rotation use the Monolog\Handler\RotatingFileHandler

use \Monolog\Logger;
use \Monolog\Handler\StreamHandler;
use \Mintdev\Monolog\Formatter\SplunkLineFormatter;
use \Monolog\Level;

$log = new Logger('DEMO');
$handler = new StreamHandler('php://stdout', Level::Info);
$handler->setFormatter(new SplunkLineFormatter());
$log->pushHandler($handler);

$log->addError('Bad stuff happened', array('detail1' => 'something', 'detail2' => 'otherthing'));

Thanks to

Part of this project is based on an old project from Vube: https://github.com/vube/monolog-splunk-formatter

It's completely redesigned but many aspects are taken from that project. So thank you!

Test

Tests are created using Pest

./vendor/bin/pest

License

This project is licensed as Open Source under MIT license

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-11-18