diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 5594d8e6b3..37e749597f 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -41,7 +41,9 @@ class Handler extends ExceptionHandler public function report(Throwable $exception) { if ($this->shouldReport($exception)) { - \Log::error($exception); + if (class_exists(\Log::class)) { + \Log::error($exception); + } return parent::report($exception); } } diff --git a/config/logging.php b/config/logging.php index cdd0bbcbdf..94495a2a33 100644 --- a/config/logging.php +++ b/config/logging.php @@ -1,5 +1,4 @@ \Rollbar\Laravel\MonologHandler::class, 'access_token' => env('ROLLBAR_TOKEN'), 'level' => env('ROLLBAR_LEVEL', 'error'), + 'check_ignore' => function($isUncaught, $args, $payload) { + if (App::environment('production') && is_object($args) && get_class($args) == Rollbar\ErrorWrapper::class && $args->errorLevel == E_WARNING ) { + \Log::info("IGNORING E_WARNING in production mode: ".$args->getMessage()); + return true; // "TRUE - you should ignore it!" + } + return false; + }, ], ],