ErrorException {#128 #severity: E_NOTICE }
* Write to stream
* @param resource $stream
*/
protected function streamWrite($stream, LogRecord $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 is initialized, send it to all handlers as long as the bubbling chain is not interrupted
try {
$handled = true;
if (true === $handler->handle(clone $record)) {
break;
}
} catch (Throwable $e) {
$this->handleException($e, $record);
}
$level = static::toMonologLevel($level);
}
$this->addRecord($level, (string) $message, $context);
}
/**
* Adds a log record at the DEBUG level.
*
return;
}
$logLevel ??= $this->resolveLogLevel($exception);
$this->logger->log($logLevel, $message, ['exception' => $exception]);
}
/**
* Resolves the level to be used when logging the exception.
*/
} while ($class = $class->getParentClass());
}
$e = FlattenException::createFromThrowable($throwable);
$this->logException($throwable, sprintf('Uncaught PHP Exception %s: "%s" at %s line %s', $e->getClass(), $e->getMessage(), basename($e->getFile()), $e->getLine()), $logLevel);
}
/**
* @return void
*/
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;
}
* Handles a throwable by trying to convert it to a Response.
*/
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()) {
if ($pop = $request !== $this->requestStack->getMainRequest()) {
$this->requestStack->push($request);
}
try {
$response = $this->handleThrowable($exception, $request, self::MAIN_REQUEST);
} finally {
if ($pop) {
$this->requestStack->pop();
}
}
if ($hasRun) {
throw $e;
}
$hasRun = true;
$kernel->terminateWithException($e, $request);
};
}
} elseif ($event instanceof ConsoleEvent && $app = $event->getCommand()->getApplication()) {
$output = $event->getOutput();
if ($output instanceof ConsoleOutputInterface) {
$this->exceptionHandler = null;
}
try {
if (null !== $exceptionHandler) {
$exceptionHandler($exception);
return;
}
$handlerException ??= $exception;
} catch (\Throwable $handlerException) {
ErrorException
|
---|
ErrorException: Notice: fwrite(): Write of 424 bytes failed with errno=28 No space left on device at /var/www/api/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:162 at Monolog\Handler\StreamHandler->streamWrite(resource, object(LogRecord)) (/var/www/api/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:149) at Monolog\Handler\StreamHandler->write(object(LogRecord)) (/var/www/api/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php:44) at Monolog\Handler\AbstractProcessingHandler->handle(object(LogRecord)) (/var/www/api/vendor/monolog/monolog/src/Monolog/Logger.php:389) at Monolog\Logger->addRecord(object(Level), 'Uncaught PHP Exception ErrorException: "Notice: fwrite(): Write of 424 bytes failed with errno=28 No space left on device" at StreamHandler.php line 162', array('exception' => object(ErrorException))) (/var/www/api/vendor/monolog/monolog/src/Monolog/Logger.php:579) at Monolog\Logger->log(object(Level), 'Uncaught PHP Exception ErrorException: "Notice: fwrite(): Write of 424 bytes failed with errno=28 No space left on device" at StreamHandler.php line 162', array('exception' => object(ErrorException))) (/var/www/api/vendor/symfony/http-kernel/EventListener/ErrorListener.php:194) at Symfony\Component\HttpKernel\EventListener\ErrorListener->logException(object(ErrorException), 'Uncaught PHP Exception ErrorException: "Notice: fwrite(): Write of 424 bytes failed with errno=28 No space left on device" at StreamHandler.php line 162', 'critical') (/var/www/api/vendor/symfony/http-kernel/EventListener/ErrorListener.php:93) at Symfony\Component\HttpKernel\EventListener\ErrorListener->logKernelException(object(ExceptionEvent), 'kernel.exception', object(EventDispatcher)) (/var/www/api/vendor/symfony/event-dispatcher/EventDispatcher.php:220) at Symfony\Component\EventDispatcher\EventDispatcher->callListeners(array(object(Closure), object(Closure), object(Closure)), 'kernel.exception', object(ExceptionEvent)) (/var/www/api/vendor/symfony/event-dispatcher/EventDispatcher.php:56) at Symfony\Component\EventDispatcher\EventDispatcher->dispatch(object(ExceptionEvent), 'kernel.exception') (/var/www/api/vendor/symfony/http-kernel/HttpKernel.php:239) at Symfony\Component\HttpKernel\HttpKernel->handleThrowable(object(ErrorException), object(Request), 1) (/var/www/api/vendor/symfony/http-kernel/HttpKernel.php:132) at Symfony\Component\HttpKernel\HttpKernel->terminateWithException(object(ErrorException), object(Request)) (/var/www/api/vendor/symfony/http-kernel/EventListener/DebugHandlersListener.php:82) at Symfony\Component\HttpKernel\EventListener\DebugHandlersListener::Symfony\Component\HttpKernel\EventListener\{closure}(object(ErrorException)) (/var/www/api/vendor/symfony/error-handler/ErrorHandler.php:531) at Symfony\Component\ErrorHandler\ErrorHandler->handleException(object(ErrorException)) |