}
restore_error_handler();
if (!is_resource($stream)) {
$this->stream = null;
throw new \UnexpectedValueException(sprintf('The stream or file "%s" could not be opened in append mode: '.$this->errorMessage, $url) . Utils::getRecordMessageForException($record));
}
stream_set_chunk_size($stream, $this->streamChunkSize);
$this->stream = $stream;
}
if ($this->nextRotation <= $record['datetime']) {
$this->mustRotate = true;
$this->close();
}
parent::write($record);
}
/**
* Rotates the files.
*/
$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 error($message, array $context = []): void
{
$this->addRecord(static::ERROR, (string) $message, $context);
}
/**
* Adds a log record at the CRITICAL level.
*
*/
protected function writeLog($level, $message, $context)
{
$this->logger->{$level}(
$message = $this->formatMessage($message),
$context = array_merge($this->context, $context)
);
$this->fireLogEvent($level, $message, $context);
}
* @param array $context
* @return void
*/
public function error($message, array $context = [])
{
$this->writeLog(__FUNCTION__, $message, $context);
}
/**
* Log a warning message to the logs.
*
* @param array $context
* @return void
*/
public function error($message, array $context = [])
{
$this->driver()->error($message, $context);
}
/**
* Exceptional occurrences that are not errors.
*
$logger->error(
$e->getMessage(),
array_merge(
$this->exceptionContext($e),
$this->context(),
['exception' => $e]
)
);
}
/**
public function handleException(Throwable $e)
{
try {
self::$reservedMemory = null;
$this->getExceptionHandler()->report($e);
} catch (Exception $e) {
//
}
if ($this->app->runningInConsole()) {
UnexpectedValueException
|
---|
UnexpectedValueException: The stream or file "/var/www/vhosts/www.ecpm.org/www/storage/logs/acorn-2025-05-24.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: Trying to access array offset on value of type null (View: /var/www/vhosts/www.ecpm.org/www/web/app/themes/novius-bedrock/resources/views/singles/single-post.blade.php) (View: /var/www/vhosts/www.ecpm.org/www/web/app/themes/novius-bedrock/resources/views/singles/single-post.blade.php) Context: {"exception":{}} at /var/www/vhosts/www.ecpm.org/www/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:146 at Monolog\Handler\StreamHandler->write() (/var/www/vhosts/www.ecpm.org/www/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php:125) at Monolog\Handler\RotatingFileHandler->write() (/var/www/vhosts/www.ecpm.org/www/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php:48) at Monolog\Handler\AbstractProcessingHandler->handle() (/var/www/vhosts/www.ecpm.org/www/vendor/monolog/monolog/src/Monolog/Logger.php:359) at Monolog\Logger->addRecord() (/var/www/vhosts/www.ecpm.org/www/vendor/monolog/monolog/src/Monolog/Logger.php:602) at Monolog\Logger->error() (/var/www/vhosts/www.ecpm.org/www/vendor/illuminate/log/Logger.php:183) at Illuminate\Log\Logger->writeLog() (/var/www/vhosts/www.ecpm.org/www/vendor/illuminate/log/Logger.php:94) at Illuminate\Log\Logger->error() (/var/www/vhosts/www.ecpm.org/www/vendor/illuminate/log/LogManager.php:590) at Illuminate\Log\LogManager->error() (/var/www/vhosts/www.ecpm.org/www/vendor/roots/acorn/src/Illuminate/Foundation/Exceptions/Handler.php:252) at Illuminate\Foundation\Exceptions\Handler->report() (/var/www/vhosts/www.ecpm.org/www/vendor/roots/acorn/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php:165) at Illuminate\Foundation\Bootstrap\HandleExceptions->handleException() |