php項目laravel框架或者lumen框架接入sentry,分為以下幾步
composer require sentry/sentry-laravel
$app->register(\Sentry\SentryLaravel\SentryLumenServiceProvider::class);
{ if (app()->bound('sentry') && $this->shouldReport($e) ) { app('sentry')->capture~~~~Exception($e); } parent::report($e); }
<?phpreturn array( 'dsn' => env('APP_ENV') == 'production' ? 'http://f0f07954a09e4544a12345090d37775:17b554b2c0934685923421090f@sentry.xxx.xxx.com/1' : 'http://57af7291232316fd7c0ea038f1:20b9273bf0fc40adba48b123b8c1231cc@sentry.xxx.xxx.com/1', // capture release as git sha // 'release' => trim(exec('git log --pretty="%h" -n1 HEAD')), // Capture bindings on SQL queries 'breadcrumbs.sql_bindings' => true, // Capture default user context 'user_context' => false,);
聯(lián)系客服