servdebt / sishandler
此包的最新版本(1.3.0)没有可用的许可证信息。
1.3.0
2022-06-20 14:39 UTC
Requires
- ext-curl: *
- ext-json: *
- monolog/monolog: 2.7.*
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);