PHP code example of aldoginting / papertrail-laravel
1. Go to this page and download the library: Download aldoginting/papertrail-laravel 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/ */
aldoginting / papertrail-laravel example snippets
$app->configureMonologUsing(function ($monolog) {
$papertrailHandler = new \PapertrailLaravel\Handler\PapertrailLogHandler({YOUR_PAPERTRAIL_HOST}, {YOUR_PAPERTRAIL_PORT}, {APP_NAME(optional)});
$formatter = new \Monolog\Formatter\LineFormatter('%level_name% REQUEST: %message%');
$papertrailHandler->setFormatter($formatter);
$monolog->pushHandler($papertrailHandler);
return $monolog;
});