Quantcast
Channel: 一言多いプログラマーの独り言
Viewing all articles
Browse latest Browse all 846

Laravel5.4でリアルタイムエラートラッキングの「Sentry」

$
0
0
Laravel5.4に、リアルタイムエラートラッキングの「Sentrysentry-laravel)」を設定してみました。わざとエラーを起こしてみても、何も起こらないので、設定が間違っているのかも。信じて、しばらく様子を見ることにします(?)。

/config/app.php

'providers' => [
Sentry\SentryLaravel\SentryLaravelServiceProvider::class,
],

'aliases' => [
'Sentry' => Sentry\SentryLaravel\SentryFacade::class,
],
/app/Exceptions/Handler.php

public function report(Exception $exception)
{
if ($this->shouldReport($exception)) {
app('sentry')->captureException($exception);
}

parent::report($exception);
}
/config/sentry.php(設定ファイルの作成)

$ php artisan vendor:publish --provider="Sentry\SentryLaravel\SentryLaravelServiceProvider"
/config/sentry.php

return array(
'dsn' => env('SENTRY_DSN'),
'breadcrumbs.sql_bindings' => true,
);

参考サイト
The Exception Handler(Laravel)
sentry-laravel(GitHub)
イベントログ収集ツールの Sentry が凄そう(Memoさん)

Viewing all articles
Browse latest Browse all 846

Trending Articles