PHP code example of butopea / monolog-logdna
1. Go to this page and download the library: Download butopea/monolog-logdna 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/ */
butopea / monolog-logdna example snippets
STION_KEY='';
\date_default_timezone_set('America/Montreal');
$logger = new \Monolog\Logger('general');
$logdnaHandler = new \Butopea\Monolog\Handler\LogdnaHandler($INGESTION_KEY, 'appname', \Monolog\Logger::DEBUG);
$logger->pushHandler($logdnaHandler);
$logger->debug('mylog');
docker run -it --rm -v "${PWD}":/usr/src/myapp -w /usr/src/myapp php:5.6-cli php test.php