*
* @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()
);
<?php
use 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 520 bytes failed with errno=28 No space left on device at /var/www/support.eidi.net/uvdesk/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:178 at Monolog\Handler\StreamHandler->streamWrite() (/var/www/support.eidi.net/uvdesk/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:162) at Monolog\Handler\StreamHandler->write() (/var/www/support.eidi.net/uvdesk/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php:48) at Monolog\Handler\AbstractProcessingHandler->handle() (/var/www/support.eidi.net/uvdesk/vendor/monolog/monolog/src/Monolog/Logger.php:399) at Monolog\Logger->addRecord() (/var/www/support.eidi.net/uvdesk/vendor/monolog/monolog/src/Monolog/Logger.php:663) at Monolog\Logger->critical() (/var/www/support.eidi.net/uvdesk/vendor/symfony/http-kernel/EventListener/ErrorListener.php:164) at Symfony\Component\HttpKernel\EventListener\ErrorListener->logException() (/var/www/support.eidi.net/uvdesk/vendor/symfony/http-kernel/EventListener/ErrorListener.php:78) at Symfony\Component\HttpKernel\EventListener\ErrorListener->logKernelException() (/var/www/support.eidi.net/uvdesk/vendor/symfony/event-dispatcher/Debug/WrappedListener.php:118) at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke() (/var/www/support.eidi.net/uvdesk/vendor/symfony/event-dispatcher/EventDispatcher.php:230) at Symfony\Component\EventDispatcher\EventDispatcher->callListeners() (/var/www/support.eidi.net/uvdesk/vendor/symfony/event-dispatcher/EventDispatcher.php:59) at Symfony\Component\EventDispatcher\EventDispatcher->dispatch() (/var/www/support.eidi.net/uvdesk/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:154) at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch() (/var/www/support.eidi.net/uvdesk/vendor/symfony/http-kernel/HttpKernel.php:223) at Symfony\Component\HttpKernel\HttpKernel->handleThrowable() (/var/www/support.eidi.net/uvdesk/vendor/symfony/http-kernel/HttpKernel.php:86) at Symfony\Component\HttpKernel\HttpKernel->handle() (/var/www/support.eidi.net/uvdesk/vendor/symfony/http-kernel/Kernel.php:202) at Symfony\Component\HttpKernel\Kernel->handle() (/var/www/support.eidi.net/uvdesk/vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35) at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run() (/var/www/support.eidi.net/uvdesk/vendor/autoload_runtime.php:35) at require_once('/var/www/support.eidi.net/uvdesk/vendor/autoload_runtime.php') (/var/www/support.eidi.net/uvdesk/public/index.php:5) |