PHP code example of yoursurprisecom / monolog-dd-udp-handler

1. Go to this page and download the library: Download yoursurprisecom/monolog-dd-udp-handler 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/ */

    

yoursurprisecom / monolog-dd-udp-handler example snippets




use Monolog\Logger;
use YourSurpriseCom\Monolog\DatadogUdp\Handler\DataDogUdpHandler;

$logger  = new Logger('my_logger');
$handler = new DataDogUdpHandler("<proxy host>",1053);
$logger->pushHandler($handler);

$logger->info("This log message is sent non blocking over UDP to Datadog!");