nohponex/monolog-datadog-handler

Monolog Handler that uses Datadog

v0.1.0 2022-05-25 09:40 UTC

This package is auto-updated.

Last update: 2024-10-25 14:50:30 UTC


README

Monolog Handler that uses Datadog

Implemented for TCP Submission to Datadog API using datadog/php-datadogstatsd

Installation

composer require nohponex/monolog-datadog-handler

Basic Usage

<?php

use Nohponex\MonologDataDogHandler\DataDogHandler;

$tag = [
    sprintf(
        'environment:%s',
        'ci'
    ),
    sprintf(
        'instance:%s',
        'api'
    )
];

$log = new Logger('name');
$log->pushHandler(
    new DataDogHandler(
        'xxxx',
        'yyy',
        $tag,
        \Monolog\Logger::INFO
    )
);

License

nohponex/monolog-datadog-handler is licensed under the MIT License - see the LICENSE file for details