PHP code example of bloatless / mono-pile
1. Go to this page and download the library: Download bloatless/mono-pile 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/ */
bloatless / mono-pile example snippets
// init Monolog
$logger = new \Monolog\Logger('MyLogger');
// init Pile handler and formatter
$handler = new \Bloatless\MonoPile\PileHandler('https://my.pileinstance.com/api/v1/log', 'myapikey');
$formatter = new \Bloatless\MonoPile\PileFormatter('SomeProjectId');
$handler->setFormatter($formatter);
// Push handler into Monolog
$logger->pushHandler($handler);
// Log your errors
$logger->debug('Some debug message...');
php composer.phar