}
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;
}
$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): void
{
$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 = []): void
{
$this->writeLog(__FUNCTION__, $message, $context);
}
/**
* Log a warning message to the logs.
*
* @param array $context
* @return void
*/
public function error($message, array $context = []): void
{
$this->driver()->error($message, $context);
}
/**
* Exceptional occurrences that are not errors.
*
$this->context(),
['exception' => $e]
);
method_exists($logger, $level)
? $logger->{$level}($e->getMessage(), $context)
: $logger->log($level, $e->getMessage(), $context);
}
/**
* Determine if the exception should be reported.
public function handleException(Throwable $e)
{
self::$reservedMemory = null;
try {
$this->getExceptionHandler()->report($e);
} catch (Exception $e) {
//
}
if (static::$app->runningInConsole()) {
* @return callable
*/
protected function forwardsTo($method)
{
return fn (...$arguments) => static::$app
? $this->{$method}(...$arguments)
: false;
}
/**
* Determine if the error level is a deprecation.
UnexpectedValueException
|
---|
UnexpectedValueException: The stream or file "/var/www/html/eirc-icai.org/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: The stream or file "/var/www/html/eirc-icai.org/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: The /var/www/html/eirc-icai.org/bootstrap/cache directory must be present and writable. Context: {"exception":{}} Context: {"exception":{}} at /var/www/html/eirc-icai.org/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:146 at Monolog\Handler\StreamHandler->write(array('message' => 'The stream or file "/var/www/html/eirc-icai.org/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission deniedThe exception occurred while attempting to log: The /var/www/html/eirc-icai.org/bootstrap/cache directory must be present and writable.Context: {"exception":{}}', 'context' => array('exception' => object(UnexpectedValueException)), 'level' => 400, 'level_name' => 'ERROR', 'channel' => 'local', 'datetime' => object(DateTimeImmutable), 'extra' => array(), 'formatted' => '[2024-03-19 18:47:00] local.ERROR: The stream or file "/var/www/html/eirc-icai.org/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission deniedThe exception occurred while attempting to log: The /var/www/html/eirc-icai.org/bootstrap/cache directory must be present and writable.Context: {"exception":{}} {"exception":"[object] (UnexpectedValueException(code: 0): The stream or file \\"/var/www/html/eirc-icai.org/storage/logs/laravel.log\\" could not be opened in append mode: Failed to open stream: Permission deniedThe exception occurred while attempting to log: The /var/www/html/eirc-icai.org/bootstrap/cache directory must be present and writable.Context: {\\"exception\\":{}} at /var/www/html/eirc-icai.org/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:146)[stacktrace]#0 /var/www/html/eirc-icai.org/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php(48): Monolog\\\\Handler\\\\StreamHandler->write(Array)#1 /var/www/html/eirc-icai.org/vendor/monolog/monolog/src/Monolog/Logger.php(359): Monolog\\\\Handler\\\\AbstractProcessingHandler->handle(Array)#2 /var/www/html/eirc-icai.org/vendor/monolog/monolog/src/Monolog/Logger.php(602): Monolog\\\\Logger->addRecord(400, \'The /var/www/ht...\', Array)#3 /var/www/html/eirc-icai.org/vendor/laravel/framework/src/Illuminate/Log/Logger.php(183): Monolog\\\\Logger->error(\'The /var/www/ht...\', Array)#4 /var/www/html/eirc-icai.org/vendor/laravel/framework/src/Illuminate/Log/Logger.php(94): Illuminate\\\\Log\\\\Logger->writeLog(\'error\', \'The /var/www/ht...\', Array)#5 /var/www/html/eirc-icai.org/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(636): Illuminate\\\\Log\\\\Logger->error(\'The /var/www/ht...\', Array)#6 /var/www/html/eirc-icai.org/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(275): Illuminate\\\\Log\\\\LogManager->error(\'The /var/www/ht...\', Array)#7 /var/www/html/eirc-icai.org/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(415): Illuminate\\\\Foundation\\\\Exceptions\\\\Handler->report(Object(Exception))#8 /var/www/html/eirc-icai.org/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(113): Illuminate\\\\Foundation\\\\Http\\\\Kernel->reportException(Object(Exception))#9 /var/www/html/eirc-icai.org/index.php(52): Illuminate\\\\Foundation\\\\Http\\\\Kernel->handle(Object(Illuminate\\\\Http\\\\Request))#10 {main}"} ')) (/var/www/html/eirc-icai.org/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php:48) at Monolog\Handler\AbstractProcessingHandler->handle(array('message' => 'The stream or file "/var/www/html/eirc-icai.org/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission deniedThe exception occurred while attempting to log: The /var/www/html/eirc-icai.org/bootstrap/cache directory must be present and writable.Context: {"exception":{}}', 'context' => array('exception' => object(UnexpectedValueException)), 'level' => 400, 'level_name' => 'ERROR', 'channel' => 'local', 'datetime' => object(DateTimeImmutable), 'extra' => array(), 'formatted' => '[2024-03-19 18:47:00] local.ERROR: The stream or file "/var/www/html/eirc-icai.org/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission deniedThe exception occurred while attempting to log: The /var/www/html/eirc-icai.org/bootstrap/cache directory must be present and writable.Context: {"exception":{}} {"exception":"[object] (UnexpectedValueException(code: 0): The stream or file \\"/var/www/html/eirc-icai.org/storage/logs/laravel.log\\" could not be opened in append mode: Failed to open stream: Permission deniedThe exception occurred while attempting to log: The /var/www/html/eirc-icai.org/bootstrap/cache directory must be present and writable.Context: {\\"exception\\":{}} at /var/www/html/eirc-icai.org/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:146)[stacktrace]#0 /var/www/html/eirc-icai.org/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php(48): Monolog\\\\Handler\\\\StreamHandler->write(Array)#1 /var/www/html/eirc-icai.org/vendor/monolog/monolog/src/Monolog/Logger.php(359): Monolog\\\\Handler\\\\AbstractProcessingHandler->handle(Array)#2 /var/www/html/eirc-icai.org/vendor/monolog/monolog/src/Monolog/Logger.php(602): Monolog\\\\Logger->addRecord(400, \'The /var/www/ht...\', Array)#3 /var/www/html/eirc-icai.org/vendor/laravel/framework/src/Illuminate/Log/Logger.php(183): Monolog\\\\Logger->error(\'The /var/www/ht...\', Array)#4 /var/www/html/eirc-icai.org/vendor/laravel/framework/src/Illuminate/Log/Logger.php(94): Illuminate\\\\Log\\\\Logger->writeLog(\'error\', \'The /var/www/ht...\', Array)#5 /var/www/html/eirc-icai.org/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(636): Illuminate\\\\Log\\\\Logger->error(\'The /var/www/ht...\', Array)#6 /var/www/html/eirc-icai.org/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(275): Illuminate\\\\Log\\\\LogManager->error(\'The /var/www/ht...\', Array)#7 /var/www/html/eirc-icai.org/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(415): Illuminate\\\\Foundation\\\\Exceptions\\\\Handler->report(Object(Exception))#8 /var/www/html/eirc-icai.org/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(113): Illuminate\\\\Foundation\\\\Http\\\\Kernel->reportException(Object(Exception))#9 /var/www/html/eirc-icai.org/index.php(52): Illuminate\\\\Foundation\\\\Http\\\\Kernel->handle(Object(Illuminate\\\\Http\\\\Request))#10 {main}"} ')) (/var/www/html/eirc-icai.org/vendor/monolog/monolog/src/Monolog/Logger.php:359) at Monolog\Logger->addRecord(400, 'The stream or file "/var/www/html/eirc-icai.org/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission deniedThe exception occurred while attempting to log: The /var/www/html/eirc-icai.org/bootstrap/cache directory must be present and writable.Context: {"exception":{}}', array('exception' => object(UnexpectedValueException))) (/var/www/html/eirc-icai.org/vendor/monolog/monolog/src/Monolog/Logger.php:602) at Monolog\Logger->error('The stream or file "/var/www/html/eirc-icai.org/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission deniedThe exception occurred while attempting to log: The /var/www/html/eirc-icai.org/bootstrap/cache directory must be present and writable.Context: {"exception":{}}', array('exception' => object(UnexpectedValueException))) (/var/www/html/eirc-icai.org/vendor/laravel/framework/src/Illuminate/Log/Logger.php:183) at Illuminate\Log\Logger->writeLog('error', 'The stream or file "/var/www/html/eirc-icai.org/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission deniedThe exception occurred while attempting to log: The /var/www/html/eirc-icai.org/bootstrap/cache directory must be present and writable.Context: {"exception":{}}', array('exception' => object(UnexpectedValueException))) (/var/www/html/eirc-icai.org/vendor/laravel/framework/src/Illuminate/Log/Logger.php:94) at Illuminate\Log\Logger->error('The stream or file "/var/www/html/eirc-icai.org/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission deniedThe exception occurred while attempting to log: The /var/www/html/eirc-icai.org/bootstrap/cache directory must be present and writable.Context: {"exception":{}}', array('exception' => object(UnexpectedValueException))) (/var/www/html/eirc-icai.org/vendor/laravel/framework/src/Illuminate/Log/LogManager.php:636) at Illuminate\Log\LogManager->error('The stream or file "/var/www/html/eirc-icai.org/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission deniedThe exception occurred while attempting to log: The /var/www/html/eirc-icai.org/bootstrap/cache directory must be present and writable.Context: {"exception":{}}', array('exception' => object(UnexpectedValueException))) (/var/www/html/eirc-icai.org/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php:275) at Illuminate\Foundation\Exceptions\Handler->report(object(UnexpectedValueException)) (/var/www/html/eirc-icai.org/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php:189) at Illuminate\Foundation\Bootstrap\HandleExceptions->handleException(object(UnexpectedValueException)) (/var/www/html/eirc-icai.org/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php:257) at Illuminate\Foundation\Bootstrap\HandleExceptions->Illuminate\Foundation\Bootstrap\{closure}(object(UnexpectedValueException)) |