Merge pull request #12517 from uberbrady/silence_ldap_exceptions

Silence E_WARNING "exceptions"
This commit is contained in:
snipe 2023-02-15 11:56:37 -08:00 committed by GitHub
commit 7980e2ab2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View file

@ -41,7 +41,9 @@ class Handler extends ExceptionHandler
public function report(Throwable $exception) public function report(Throwable $exception)
{ {
if ($this->shouldReport($exception)) { if ($this->shouldReport($exception)) {
if (class_exists(\Log::class)) {
\Log::error($exception); \Log::error($exception);
}
return parent::report($exception); return parent::report($exception);
} }
} }

View file

@ -1,5 +1,4 @@
<?php <?php
use Monolog\Handler\NullHandler; use Monolog\Handler\NullHandler;
use Monolog\Handler\StreamHandler; use Monolog\Handler\StreamHandler;
use Monolog\Handler\SyslogUdpHandler; use Monolog\Handler\SyslogUdpHandler;
@ -113,6 +112,13 @@ $config = [
'handler' => \Rollbar\Laravel\MonologHandler::class, 'handler' => \Rollbar\Laravel\MonologHandler::class,
'access_token' => env('ROLLBAR_TOKEN'), 'access_token' => env('ROLLBAR_TOKEN'),
'level' => env('ROLLBAR_LEVEL', 'error'), '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;
},
], ],
], ],