PHP code example of itsmill3rtime / sentry-laravel-5-7
1. Go to this page and download the library: Download itsmill3rtime/sentry-laravel-5-7 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/ */
itsmill3rtime / sentry-laravel-5-7 example snippets
public function report(Exception $exception)
{
if (app()->bound('sentry') && $this->shouldReport($exception)) {
app('sentry')->captureException($exception);
}
parent::report($exception);
}
$app->register('Sentry\SentryLaravel\SentryLumenServiceProvider');
# Sentry must be registered before routes are included
public function report(Exception $e)
{
if (app()->bound('sentry') && $this->shouldReport($e)) {
app('sentry')->captureException($e);
}
parent::report($e);
}
'channels' => [
'stack' => [
'driver' => 'stack',
// Add the Sentry log channel to the stack
'channels' => ['single', 'sentry'],
],
//...
],
'channels' => [
// ...
'sentry' => [
'driver' => 'sentry',
'level' => null, // The minimum monolog logging level at which this handler will be triggered
// For example: `\Monolog\Logger::ERROR`
'bubble' => true, // Whether the messages that are handled can bubble up the stack or not
],
],
namespace App\Support;
class SentryLaravelServiceProvider extends \Sentry\SentryLaravel\SentryLaravelServiceProvider
{
public static $abstract = 'sentry-laravel';
}