*
* @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->called = true;
$this->priority = $dispatcher->getListenerPriority($eventName, $this->listener);
$e = $this->stopwatch->start($this->name, 'event_listener');
($this->optimizedListener ?? $this->listener)($event, $eventName, $dispatcher);
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);
}
}
/**
* {@inheritdoc}
$this->boot();
++$this->requestStackSize;
$this->resetServices = true;
try {
return $this->getHttpKernel()->handle($request, $type, $catch);
} finally {
--$this->requestStackSize;
}
}
Debug::enable();
}
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
ErrorException
|
---|
ErrorException: Notice: fwrite(): Write of 550 bytes failed with errno=122 Disk quota exceeded at /home/clients/b01bb7fa8d2a3af486408ecf3447a183/web/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:178 at Monolog\Handler\StreamHandler->streamWrite(resource, array('message' => 'Uncaught PHP Exception ErrorException: "Notice: fwrite(): Write of 402 bytes failed with errno=122 Disk quota exceeded" at /home/clients/b01bb7fa8d2a3af486408ecf3447a183/web/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php line 178', 'context' => array('exception' => object(ErrorException)), 'level' => 500, 'level_name' => 'CRITICAL', 'channel' => 'request', 'datetime' => object(DateTimeImmutable), 'extra' => array(), 'formatted' => '[2024-03-29T16:20:54.455573+01:00] request.CRITICAL: Uncaught PHP Exception ErrorException: "Notice: fwrite(): Write of 402 bytes failed with errno=122 Disk quota exceeded" at /home/clients/b01bb7fa8d2a3af486408ecf3447a183/web/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php line 178 {"exception":"[object] (ErrorException(code: 0): Notice: fwrite(): Write of 402 bytes failed with errno=122 Disk quota exceeded at /home/clients/b01bb7fa8d2a3af486408ecf3447a183/web/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:178)"} []')) (/home/clients/b01bb7fa8d2a3af486408ecf3447a183/web/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:162) at Monolog\Handler\StreamHandler->write(array('message' => 'Uncaught PHP Exception ErrorException: "Notice: fwrite(): Write of 402 bytes failed with errno=122 Disk quota exceeded" at /home/clients/b01bb7fa8d2a3af486408ecf3447a183/web/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php line 178', 'context' => array('exception' => object(ErrorException)), 'level' => 500, 'level_name' => 'CRITICAL', 'channel' => 'request', 'datetime' => object(DateTimeImmutable), 'extra' => array(), 'formatted' => '[2024-03-29T16:20:54.455573+01:00] request.CRITICAL: Uncaught PHP Exception ErrorException: "Notice: fwrite(): Write of 402 bytes failed with errno=122 Disk quota exceeded" at /home/clients/b01bb7fa8d2a3af486408ecf3447a183/web/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php line 178 {"exception":"[object] (ErrorException(code: 0): Notice: fwrite(): Write of 402 bytes failed with errno=122 Disk quota exceeded at /home/clients/b01bb7fa8d2a3af486408ecf3447a183/web/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:178)"} []')) (/home/clients/b01bb7fa8d2a3af486408ecf3447a183/web/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php:48) at Monolog\Handler\AbstractProcessingHandler->handle(array('message' => 'Uncaught PHP Exception ErrorException: "Notice: fwrite(): Write of 402 bytes failed with errno=122 Disk quota exceeded" at /home/clients/b01bb7fa8d2a3af486408ecf3447a183/web/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php line 178', 'context' => array('exception' => object(ErrorException)), 'level' => 500, 'level_name' => 'CRITICAL', 'channel' => 'request', 'datetime' => object(DateTimeImmutable), 'extra' => array(), 'formatted' => '[2024-03-29T16:20:54.455573+01:00] request.CRITICAL: Uncaught PHP Exception ErrorException: "Notice: fwrite(): Write of 402 bytes failed with errno=122 Disk quota exceeded" at /home/clients/b01bb7fa8d2a3af486408ecf3447a183/web/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php line 178 {"exception":"[object] (ErrorException(code: 0): Notice: fwrite(): Write of 402 bytes failed with errno=122 Disk quota exceeded at /home/clients/b01bb7fa8d2a3af486408ecf3447a183/web/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:178)"} []')) (/home/clients/b01bb7fa8d2a3af486408ecf3447a183/web/vendor/monolog/monolog/src/Monolog/Logger.php:327) at Monolog\Logger->addRecord(500, 'Uncaught PHP Exception ErrorException: "Notice: fwrite(): Write of 402 bytes failed with errno=122 Disk quota exceeded" at /home/clients/b01bb7fa8d2a3af486408ecf3447a183/web/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php line 178', array('exception' => object(ErrorException))) (/home/clients/b01bb7fa8d2a3af486408ecf3447a183/web/vendor/monolog/monolog/src/Monolog/Logger.php:578) at Monolog\Logger->critical('Uncaught PHP Exception ErrorException: "Notice: fwrite(): Write of 402 bytes failed with errno=122 Disk quota exceeded" at /home/clients/b01bb7fa8d2a3af486408ecf3447a183/web/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php line 178', array('exception' => object(ErrorException))) (/home/clients/b01bb7fa8d2a3af486408ecf3447a183/web/vendor/symfony/http-kernel/EventListener/ErrorListener.php:158) at Symfony\Component\HttpKernel\EventListener\ErrorListener->logException(object(ErrorException), 'Uncaught PHP Exception ErrorException: "Notice: fwrite(): Write of 402 bytes failed with errno=122 Disk quota exceeded" at /home/clients/b01bb7fa8d2a3af486408ecf3447a183/web/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php line 178', null) (/home/clients/b01bb7fa8d2a3af486408ecf3447a183/web/vendor/symfony/http-kernel/EventListener/ErrorListener.php:72) at Symfony\Component\HttpKernel\EventListener\ErrorListener->logKernelException(object(ExceptionEvent), 'kernel.exception', object(TraceableEventDispatcher)) (/home/clients/b01bb7fa8d2a3af486408ecf3447a183/web/vendor/symfony/event-dispatcher/Debug/WrappedListener.php:117) at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke(object(ExceptionEvent), 'kernel.exception', object(TraceableEventDispatcher)) (/home/clients/b01bb7fa8d2a3af486408ecf3447a183/web/vendor/symfony/event-dispatcher/EventDispatcher.php:230) at Symfony\Component\EventDispatcher\EventDispatcher->callListeners(array(object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener)), 'kernel.exception', object(ExceptionEvent)) (/home/clients/b01bb7fa8d2a3af486408ecf3447a183/web/vendor/symfony/event-dispatcher/EventDispatcher.php:59) at Symfony\Component\EventDispatcher\EventDispatcher->dispatch(object(ExceptionEvent), 'kernel.exception') (/home/clients/b01bb7fa8d2a3af486408ecf3447a183/web/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:154) at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch(object(ExceptionEvent), 'kernel.exception') (/home/clients/b01bb7fa8d2a3af486408ecf3447a183/web/vendor/symfony/http-kernel/HttpKernel.php:213) at Symfony\Component\HttpKernel\HttpKernel->handleThrowable(object(ErrorException), object(Request), 1) (/home/clients/b01bb7fa8d2a3af486408ecf3447a183/web/vendor/symfony/http-kernel/HttpKernel.php:85) at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true) (/home/clients/b01bb7fa8d2a3af486408ecf3447a183/web/vendor/symfony/http-kernel/Kernel.php:202) at Symfony\Component\HttpKernel\Kernel->handle(object(Request)) (/home/clients/b01bb7fa8d2a3af486408ecf3447a183/web/public/index.php:20) |