PHP code example of jenssegers / raven

1. Go to this page and download the library: Download jenssegers/raven 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/ */

    

jenssegers / raven example snippets


Jenssegers\Raven\RavenServiceProvider::class,

if ($this->app->environment('production')) {
    $this->app->register(Jenssegers\Raven\RavenServiceProvider::class);
}

'Raven'           => Jenssegers\Raven\Facades\Raven::class,

'raven' => [
    'dsn'   => env('RAVEN_DSN'),
    'level' => env('LOG_LEVEL'),
],

try {
	something();
} catch (\Exception $e) {
	Log::error($e);
}

Log::debug('Here is some debug information');

use Jenssegers\Raven\RavenHandler as Raven;

...

public function index(Request $request, Raven $raven)
{
	Raven::info('Request received!');
}

Log::error('Something went wrong', [
    'user' => ['name' => 'John Doe', 'email' => '[email protected]']
]);

Log::info('Task completed', [
    'tags' => ['state' => 1234]
]);

Log::warning('Something went wrong', [
    'download_size' => 3432425235
]);

$app->register(Jenssegers\Raven\RavenServiceProvider::class);

use Jenssegers\Raven\Facades\Raven;

public function report(Exception $e)
{
    if ($this->shouldReport($e)) {
        Raven::error($e);
    }

    parent::report($e);
}