Search by

servdebt / sishandler

jupitern

There is no license information available for the latest version (1.3.0) of this package.

This package's canonical repository appears to be gone and the package has been frozen as a result. Email us for help if needed.

Package info

github.com/Servdebt/sishandler

Homepage

Type:monolog-handler

pkg:composer/servdebt/sishandler

Statistics

Installs: 122

Dependents: 0

Suggesters: 0

Stars: 2

Open Issues: 0

1.3.0 2022-06-20 14:39 UTC

This package is auto-updated.

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


README

Allows ServDebt systems to dispatch logs to the ServDebt Improvement System API using Monolog.

Require the package

composer require servdebt/sishandler

Usage Example

You can have a look at the included example.php file or:

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);