PHP code example of rcrowe / raven

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

    

rcrowe / raven example snippets


$raven = new \rcrowe\Raven\Client(##DSN##);

$raven->captureMessage('FooBar');

$raven = new \rcrowe\Raven\Client(##DSN##);

$raven->setHandler(
    new \rcrowe\Raven\Handler\Sync
);

$raven = new \rcrowe\Raven\Client(##DSN##);

$raven->setHandler(
    new \rcrowe\Raven\Handler\Laravel(
        null,
        App::make('queue')
    );
);

$raven->setHandler(
    new \rcrowe\Raven\Handler\Sync(
        new \rcrowe\Raven\Transport\Dummy
    )
);

$raven->setHandler(
    new \rcrowe\Raven\Handler\Sync(
        new \rcrowe\Raven\Transport\Guzzle
    )
);

$raven->addHandler(
    new \rcrowe\Raven\Handler\Sync
);

'rcrowe\Raven\Provider\Laravel\RavenServiceProvider',

'Sentry' => 'rcrowe\Raven\Provider\Laravel\Facade\Raven',

'raven' => [
	'dsn' => '...'
],

try {
    throw new Exception('This is an example');
} catch (Exception $ex) {
    Log::error($ex);
}

App::error(function(Exception $exception, $code)
{
    Log::error($exception);
});

Sentry::setUser([
	'id'   => 1,
	'name' => 'Rob Crowe',
]);

Sentry::removeUser();

php artisan config:publish rcrowe/raven