* * @phpstan-param FormattedRecord $record */ protected function streamWrite($stream, array $record): void { fwrite($stream, (string) $record['formatted']); } private function customErrorHandler(int $code, string $msg): bool { $this->errorMessage = preg_replace('{^(fopen|mkdir)\(.*?\): }', '', $msg); if ($this->useLocking) { // ignoring errors here, there's not much we can do about them flock($stream, LOCK_EX); } $this->streamWrite($stream, $record); if ($this->useLocking) { flock($stream, LOCK_UN); } } $record = $this->processRecord($record); } $record['formatted'] = $this->getFormatter()->format($record); $this->write($record); return false === $this->bubble; } /** } } // once the record exists, send it to all handlers as long as the bubbling chain is not interrupted try { if (true === $handler->handle($record)) { break; } } catch (Throwable $e) { $this->handleException($e, $record); * @param string|Stringable $message The log message * @param mixed[] $context The log context */ public function critical($message, array $context = []): void { $this->addRecord(static::CRITICAL, (string) $message, $context); } /** * Adds a log record at the ALERT level. * { if (null !== $this->logger) { if (null !== $logLevel) { $this->logger->log($logLevel, $message, ['exception' => $exception]); } elseif (!$exception instanceof HttpExceptionInterface || $exception->getStatusCode() >= 500) { $this->logger->critical($message, ['exception' => $exception]); } else { $this->logger->error($message, ['exception' => $exception]); } } } break; } $e = FlattenException::createFromThrowable($throwable); $this->logException($throwable, sprintf('Uncaught PHP Exception %s: "%s" at %s line %s', $e->getClass(), $e->getMessage(), $e->getFile(), $e->getLine()), $logLevel); } public function onKernelException(ExceptionEvent $event) { if (null === $this->controller) { $this->priority = $dispatcher->getListenerPriority($eventName, $this->listener); $e = $this->stopwatch->start($this->name, 'event_listener'); try { ($this->optimizedListener ?? $this->listener)($event, $eventName, $dispatcher); } finally { if ($e->isStarted()) { $e->stop(); } } foreach ($listeners as $listener) { if ($stoppable && $event->isPropagationStopped()) { break; } $listener($event, $eventName, $this); } } /** * Sorts the internal list of listeners for the given event by priority. } else { $listeners = $this->getListeners($eventName); } if ($listeners) { $this->callListeners($listeners, $eventName, $event); } return $event; } try { $this->beforeDispatch($eventName, $event); try { $e = $this->stopwatch->start($eventName, 'section'); try { $this->dispatcher->dispatch($event, $eventName); } finally { if ($e->isStarted()) { $e->stop(); } } * @throws \Exception */ private function handleThrowable(\Throwable $e, Request $request, int $type): Response { $event = new ExceptionEvent($this, $request, $type, $e); $this->dispatcher->dispatch($event, KernelEvents::EXCEPTION); // a listener might have replaced the exception $e = $event->getThrowable(); if (!$event->hasResponse()) { $this->finishRequest($request, $type); throw $e; } return $this->handleThrowable($e, $request, $type); } finally { $this->requestStack->pop(); } } $this->boot(); ++$this->requestStackSize; $this->resetServices = true; try { return $this->getHttpKernel()->handle($request, $type, $catch); } finally { --$this->requestStackSize; } } $this->request = $request; } public function run(): int { $response = $this->kernel->handle($this->request); $response->send(); if ($this->kernel instanceof TerminableInterface) { $this->kernel->terminate($this->request, $response); }$app = $app(...$args);exit( $runtime ->getRunner($app) ->run());<?phpuse App\Kernel;require_once dirname(__DIR__).'/vendor/autoload_runtime.php';return function (array $context) { return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);};|
ErrorException
|
|---|
ErrorException:
Notice: fwrite(): Write of 586 bytes failed with errno=28 No space left on device
at /home/akshay/workstation/projects/crypque-support/crypque-support/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:181
at Monolog\Handler\StreamHandler->streamWrite()
(/home/akshay/workstation/projects/crypque-support/crypque-support/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:165)
at Monolog\Handler\StreamHandler->write()
(/home/akshay/workstation/projects/crypque-support/crypque-support/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php:48)
at Monolog\Handler\AbstractProcessingHandler->handle()
(/home/akshay/workstation/projects/crypque-support/crypque-support/vendor/monolog/monolog/src/Monolog/Logger.php:399)
at Monolog\Logger->addRecord()
(/home/akshay/workstation/projects/crypque-support/crypque-support/vendor/monolog/monolog/src/Monolog/Logger.php:663)
at Monolog\Logger->critical()
(/home/akshay/workstation/projects/crypque-support/crypque-support/vendor/symfony/http-kernel/EventListener/ErrorListener.php:164)
at Symfony\Component\HttpKernel\EventListener\ErrorListener->logException()
(/home/akshay/workstation/projects/crypque-support/crypque-support/vendor/symfony/http-kernel/EventListener/ErrorListener.php:78)
at Symfony\Component\HttpKernel\EventListener\ErrorListener->logKernelException()
(/home/akshay/workstation/projects/crypque-support/crypque-support/vendor/symfony/event-dispatcher/Debug/WrappedListener.php:118)
at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke()
(/home/akshay/workstation/projects/crypque-support/crypque-support/vendor/symfony/event-dispatcher/EventDispatcher.php:230)
at Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
(/home/akshay/workstation/projects/crypque-support/crypque-support/vendor/symfony/event-dispatcher/EventDispatcher.php:59)
at Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
(/home/akshay/workstation/projects/crypque-support/crypque-support/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:154)
at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch()
(/home/akshay/workstation/projects/crypque-support/crypque-support/vendor/symfony/http-kernel/HttpKernel.php:223)
at Symfony\Component\HttpKernel\HttpKernel->handleThrowable()
(/home/akshay/workstation/projects/crypque-support/crypque-support/vendor/symfony/http-kernel/HttpKernel.php:86)
at Symfony\Component\HttpKernel\HttpKernel->handle()
(/home/akshay/workstation/projects/crypque-support/crypque-support/vendor/symfony/http-kernel/Kernel.php:202)
at Symfony\Component\HttpKernel\Kernel->handle()
(/home/akshay/workstation/projects/crypque-support/crypque-support/vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35)
at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
(/home/akshay/workstation/projects/crypque-support/crypque-support/vendor/autoload_runtime.php:35)
at require_once('/home/akshay/workstation/projects/crypque-support/crypque-support/vendor/autoload_runtime.php')
(/home/akshay/workstation/projects/crypque-support/crypque-support/public/index.php:5)
|