servdebt/sishandler

此包的最新版本(1.3.0)没有可用的许可证信息。

安装: 122

依赖: 0

建议者: 0

安全性: 0

星标: 2

关注者: 3

分支: 1

开放问题: 0

类型:monolog-handler

1.3.0 2022-06-20 14:39 UTC

This package is auto-updated.

Last update: 2022-08-20 15:00:47 UTC


README

允许 ServDebt 系统使用 Monolog 将日志派发到 ServDebt 改进系统 API。

需要此包

composer require servdebt/sishandler

使用示例

您可以查看包含的 example.php 文件或

use Monolog\Logger;
use Monolog\Processor\IntrospectionProcessor;
use Monolog\Handler\SISHandler;

// Adjust your settings
$apiKey = "SISAPIKey";
$apiUrl = "SISServerURL/api/logs";

// Create a log channel
$log = new Logger("ExampleChannel");
$log->pushHandler(new SISHandler($apiUrl, $apiKey));

// Optionally add IntrospectionProcessor to get the file path and line number where the log was generated
$log->pushProcessor(new IntrospectionProcessor());

// Build an array with your own error data
$data = [
	"_id"      => "5bd983a152b659e726378bd1",
	"index"    => 0,
	"guid"     => "486010d2-8e64-452c-990a-8b59a608572a",
	"isActive" => true
];

// Dispatch the log
$log->warning("You error description", $data);