PHP code example of marothyzsolt / laravel-new-relic

1. Go to this page and download the library: Download marothyzsolt/laravel-new-relic 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/ */

    

marothyzsolt / laravel-new-relic example snippets


'single' => [
    'driver' => env('APP_ENV') === 'local' ? 'single' : 'custom',
    'via' => NewRelicLogger::class,
    'path' => storage_path('logs/laravel.log'),
    'level' => env('LOG_LEVEL', 'debug'),
],

php artisan vendor:publish --provider="MarothyZsolt\LaravelNewRelic\LaravelNewRelicServiceProvider"

'extra_data' => function (?Request $request, ?Throwable $throwable): array {
    return [
        'fingerprint' => $request->fingerprint(),
    ];
}

public function register()
{
    $this->reportable(function (Throwable $e) {
        app(\App\Logging\NewRelicLogger::class)->throwable($e);
    });
}