getMethods( ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PROTECTED ); $result = []; foreach ($methods as $method) { // invoke the method so we can collect the result of execution it $result[$method->name] = $method->invoke($exception); } // Clear the unnecessary method unset($result['getTrace']); unset($result['__toString']); // clear the null values then encode it as json // so we can decode it as an object in the Monolog Processor $result = json_encode(array_filter($result)); return Log::emergency($result); } public function render($request, Throwable $exception) { return parent::render($request, $exception); } }