PHP code example of cutesquirrel / datadog-monolog

1. Go to this page and download the library: Download cutesquirrel/datadog-monolog library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

cutesquirrel / datadog-monolog example snippets




use Monolog\Logger;
use cutesquirrel\DatadogMonolog\DatadogHandler;

// create a log channel
$log = new Logger('name');
$log->pushHandler(new DatadogHandler('<your-token>'));

// add records to the log
$log->warning('Foo');
$log->error('Bar');