当前位置: 首页>>代码示例>>PHP>>正文


PHP Handler::report方法代码示例

本文整理汇总了PHP中Illuminate\Foundation\Exceptions\Handler::report方法的典型用法代码示例。如果您正苦于以下问题:PHP Handler::report方法的具体用法?PHP Handler::report怎么用?PHP Handler::report使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Foundation\Exceptions\Handler的用法示例。


在下文中一共展示了Handler::report方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: report

 /**
  * Report or log an exception.
  *
  * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
  *
  * @param  \Exception  $e
  * @return void
  */
 public function report(Exception $e)
 {
     if (app()->environment('production')) {
         app(ErrorReporting::class)->send($e);
     }
     return parent::report($e);
 }
开发者ID:valdinei,项目名称:rest,代码行数:15,代码来源:Handler.php

示例2: report

 /**
  * Report or log an exception.
  *
  * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
  *
  * @param \Exception $e
  *
  * @return void
  */
 public function report(Exception $e)
 {
     if ($this->shouldReport($e) && app()->bound('bugsnag')) {
         app('bugsnag')->notifyException($e, null, 'error');
     }
     return parent::report($e);
 }
开发者ID:xing393939,项目名称:Laravel-5-Bootstrap-3-Starter-Site,代码行数:16,代码来源:BugsnagExceptionHandler.php

示例3: report

 /**
  * Report or log an exception.
  *
  * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
  *
  * @param  \Exception  $e
  * @return void
  */
 public function report(Exception $e)
 {
     if (!config('app.debug') && $this->shouldReport($e)) {
         if ($this->isHttpException($e)) {
             $status_code = $e->getStatusCode();
         } else {
             $status_code = $e->getCode();
         }
         Cache::remember('suppress-error-notification:' . $status_code . ':' . $e->getFile() . ':' . $e->getLine(), Carbon::now()->addHours(config('sns-error-notification.cache-hours')), function () use($e, $status_code) {
             // Build the "trace" variable
             if (method_exists($e, 'getTrace')) {
                 $all_trace = $e->getTrace();
                 $trace_items = [];
                 foreach ($all_trace as $item) {
                     $trace_items[] = "    " . json_encode($item);
                 }
                 if (count($trace_items)) {
                     $trace = implode("\n\n", $trace_items);
                 } else {
                     $trace = '(No trace data)';
                 }
             } else {
                 $trace = '(exception does not have a trace method)';
             }
             $message = $e->getMessage();
             if (!$message) {
                 $message = "Error in " . $e->getFile();
             }
             $sns = AWS::createClient('sns');
             $result = $sns->publish(['Message' => "URL: " . Request::fullUrl() . "\n" . "Method: " . Request::method() . "\n" . "Message: " . $message . "\n" . "Error Code: " . $status_code . "\n" . "File: " . $e->getFile() . "\n" . "Line: " . $e->getLine() . "\n\n" . "User ID: " . (auth()->check() ? auth()->User()->id : 'Guest') . "\n\n" . "Session: " . json_encode(session()->all()) . "\n\n" . "Request: " . json_encode(request()->all()) . "\n\n" . "Trace: " . $trace, 'Subject' => config('sns-error-notification.notification-subject'), 'TopicArn' => config('sns-error-notification.sns-topic')]);
             return true;
         });
     }
     return parent::report($e);
 }
开发者ID:jdavidbakr,项目名称:laravel-sns-error-notification,代码行数:43,代码来源:ErrorNotifier.php

示例4: report

 /**
  * Report or log an exception.
  *
  * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
  *
  * @param  \Exception  $e
  * @return void
  */
 public function report(Exception $e)
 {
     if ($this->shouldReport($e)) {
         Log::error($e);
     }
     parent::report($e);
 }
开发者ID:webfactorybulgaria,项目名称:Base,代码行数:15,代码来源:Handler.php

示例5: report

 /**
  * Report or log an exception.
  *
  * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
  *
  * @param  \Exception  $e
  * @return void
  */
 public function report(Exception $e)
 {
     if ($e instanceof QueryException) {
         return "teste";
     }
     return parent::report($e);
 }
开发者ID:GabrielDvt,项目名称:laravel2,代码行数:15,代码来源:Handler.php

示例6: report

 /**
  * Report or log an exception.
  *
  * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
  *
  * @param  \Exception  $e
  * @return void
  */
 public function report(Exception $e)
 {
     if ($this->shouldReport($e) && app()->environment() == 'local') {
         $this->mailer->getSwiftMailer()->send(SwiftMessage::newInstance(null)->addTo('log@localhost')->addFrom('noreply@localhost', 'Laravel Drydock')->setBody($this->render(null, $e)->getContent())->setContentType('text/html'));
     }
     parent::report($e);
 }
开发者ID:atrauzzi,项目名称:laravel-drydock,代码行数:15,代码来源:Handler.php

示例7: report

 /**
  * Report or log an exception.
  *
  * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
  *
  * @param  \Exception  $e
  * @return void
  */
 public function report(Exception $e)
 {
     /*if ($this->shouldReport($e)) {
           app('sentry')->captureException($e);
       }*/
     parent::report($e);
 }
开发者ID:davila7,项目名称:kayra,代码行数:15,代码来源:Handler.php

示例8: report

 /**
  * Report or log an exception.
  *
  * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
  *
  * @param  \Exception  $exception
  */
 public function report(Exception $exception)
 {
     if ($this->shouldReport($exception)) {
         app('sentry')->captureException($exception);
     }
     return parent::report($exception);
 }
开发者ID:suitmedia,项目名称:suitcoda,代码行数:14,代码来源:Handler.php

示例9: report

 /**
  * Report or log an exception.
  *
  * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
  *
  * @param  \Exception  $e
  * @return void
  */
 public function report(Exception $e)
 {
     if ($e instanceof VerifyCsrfToken) {
         Log::error('CSRF Error', ['exception' => $e, 'url' => URL::current()]);
     }
     return parent::report($e);
 }
开发者ID:jeroenhekihenk,项目名称:video-platform,代码行数:15,代码来源:Handler.php

示例10: report

 /**
  * Report or log an exception.
  *
  * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
  *
  * @param  \Exception  $e
  * @return void
  */
 public function report(Exception $e)
 {
     if (config('app.debug') && $e instanceof DevBaseException) {
         //TODO not sure what to do with custom exception, temporarily using system error pages.
     }
     return parent::report($e);
 }
开发者ID:straysh,项目名称:straysh.info,代码行数:15,代码来源:Handler.php

示例11: report

 /**
  * Report or log an exception.
  *
  * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
  *
  * @param  \Exception  $e
  * @return void
  */
 public function report(Exception $e)
 {
     if (strtolower(getenv('SLACK_ENABLE')) === 'true') {
         Slack::send("Exception: {$e->getMessage()} on file {$e->getFile()} at line {$e->getLine()}");
     }
     return parent::report($e);
 }
开发者ID:katzumi,项目名称:talent4startups,代码行数:15,代码来源:Handler.php

示例12: report

 public function report(Exception $e)
 {
     if ($this->shouldReport($e)) {
         app('bugvel')->send($e);
     }
     return parent::report($e);
 }
开发者ID:bugvel,项目名称:bugvel,代码行数:7,代码来源:BugvelExceptionHandler.php

示例13: report

 /**
  * Report or log an exception.
  *
  * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
  *
  * @param  \Exception  $e
  * @return void
  */
 public function report(Exception $e)
 {
     if ($e instanceof ModelNotFoundException) {
         abort(404);
     }
     return parent::report($e);
 }
开发者ID:belhard-user,项目名称:group2,代码行数:15,代码来源:Handler.php

示例14: report

 /**
  * Report or log an exception.
  *
  * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
  *
  * @param  \Exception  $e
  * @return void
  */
 public function report(Exception $e)
 {
     if (self::shouldReport($e)) {
         TraceToSlack::trace($e);
     }
     return parent::report($e);
 }
开发者ID:lfelin,项目名称:laravel-tracetoslack,代码行数:15,代码来源:TraceToSlackHandler.php

示例15: report

 /**
  * Report or log an exception.
  *
  * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
  *
  * @param  \Exception  $e
  * @return void
  */
 public function report(Exception $e)
 {
     if (!config('app.debug')) {
         Log::error($e);
     }
     return parent::report($e);
 }
开发者ID:dereckson,项目名称:imgubox,代码行数:15,代码来源:Handler.php


注:本文中的Illuminate\Foundation\Exceptions\Handler::report方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。