mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -08:00
Merge pull request #12694 from uberbrady/config_cachable_if_no_rollbar
Fixed #12671: Re-enable config:cache when there's no Rollbar
This commit is contained in:
commit
05b4170116
|
@ -112,27 +112,31 @@ $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!"
|
|
||||||
}
|
|
||||||
$needle = "ArieTimmerman\\Laravel\\SCIMServer\\Exceptions\\SCIMException";
|
|
||||||
if (App::environment('production') && is_string($args) && strncmp($args, $needle, strlen($needle) ) === 0 ) {
|
|
||||||
\Log::info("String: '$args' looks like a SCIM Exception; ignoring error");
|
|
||||||
return true; //yes, *do* ignore it
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
// Only add rollbar if the .env has a rollbar token
|
|
||||||
if ((env('APP_ENV')=='production') && (env('ROLLBAR_TOKEN'))) {
|
if ((env('APP_ENV')=='production') && (env('ROLLBAR_TOKEN'))) {
|
||||||
|
// Only add rollbar if the .env has a rollbar token
|
||||||
$config['channels']['stack']['channels'] = ['single', 'rollbar'];
|
$config['channels']['stack']['channels'] = ['single', 'rollbar'];
|
||||||
|
|
||||||
|
// and only add the rollbar filter under the same conditions
|
||||||
|
// Note: it will *not* be cacheable
|
||||||
|
$config['channels']['rollbar']['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!"
|
||||||
|
}
|
||||||
|
$needle = "ArieTimmerman\\Laravel\\SCIMServer\\Exceptions\\SCIMException";
|
||||||
|
if (App::environment('production') && is_string($args) && strncmp($args, $needle, strlen($needle) ) === 0 ) {
|
||||||
|
\Log::info("String: '$args' looks like a SCIM Exception; ignoring error");
|
||||||
|
return true; //yes, *do* ignore it
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue