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; $this->inodeUrl = $this->getInodeFromUrl(); } $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); * @param string|Stringable $message The log message * @param mixed[] $context The log context */ public function error(string|\Stringable $message, array $context = []): void { $this->addRecord(Level::Error, (string) $message, $context); } /** * Adds a log record at the CRITICAL level. * * @param array $context * @return void */ 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. * ); $context = $this->buildExceptionContext($e); method_exists($logger, $level) ? $logger->{$level}($e->getMessage(), $context) : $logger->log($level, $e->getMessage(), $context); } /** * Determine if the exception should be reported. if ($this->shouldntReport($e)) { return; } $this->reportThrowable($e); } /** * Reports error based on report method on exception or to logger. * * @param \Throwable $e * @return void */ protected function reportException(Throwable $e) { $this->app[ExceptionHandler::class]->report($e); } /** * Render the exception to a response. * try { $request->enableHttpMethodParameterOverride(); $response = $this->sendRequestThroughRouter($request); } catch (Throwable $e) { $this->reportException($e); $response = $this->renderException($request, $e); } $this->app['events']->dispatch(// Bootstrap Laravel and handle the request...$app = require_once __DIR__.'/../bootstrap/app.php';$kernel = $app->make(Kernel::class);$response = $kernel->handle( $request = Request::capture())->send();$kernel->terminate($request, $response);|
UnexpectedValueException
|
|---|
UnexpectedValueException:
The stream or file "/var/www/html/chatbot/service/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/chatbot/service/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/chatbot/service/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/chatbot/service/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied
The exception occurred while attempting to log: file_put_contents(/var/www/html/chatbot/service/storage/framework/views/add5d1b4e53f1613ff65f9e75bc2faaa.php): Failed to open stream: Permission denied
Context: {"exception":{}}
Context: {"exception":{}}
Context: {"exception":{}}
Context: {"exception":{}}
at /var/www/html/chatbot/service/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:164
at Monolog\Handler\StreamHandler->write(object(LogRecord))
(/var/www/html/chatbot/service/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php:44)
at Monolog\Handler\AbstractProcessingHandler->handle(object(LogRecord))
(/var/www/html/chatbot/service/vendor/monolog/monolog/src/Monolog/Logger.php:391)
at Monolog\Logger->addRecord(object(Level), 'The stream or file "/var/www/html/chatbot/service/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission deniedThe exception occurred while attempting to log: The stream or file "/var/www/html/chatbot/service/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission deniedThe exception occurred while attempting to log: The stream or file "/var/www/html/chatbot/service/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission deniedThe exception occurred while attempting to log: file_put_contents(/var/www/html/chatbot/service/storage/framework/views/add5d1b4e53f1613ff65f9e75bc2faaa.php): Failed to open stream: Permission deniedContext: {"exception":{}}Context: {"exception":{}}Context: {"exception":{}}', array('exception' => object(UnexpectedValueException)))
(/var/www/html/chatbot/service/vendor/monolog/monolog/src/Monolog/Logger.php:646)
at Monolog\Logger->error('The stream or file "/var/www/html/chatbot/service/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission deniedThe exception occurred while attempting to log: The stream or file "/var/www/html/chatbot/service/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission deniedThe exception occurred while attempting to log: The stream or file "/var/www/html/chatbot/service/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission deniedThe exception occurred while attempting to log: file_put_contents(/var/www/html/chatbot/service/storage/framework/views/add5d1b4e53f1613ff65f9e75bc2faaa.php): Failed to open stream: Permission deniedContext: {"exception":{}}Context: {"exception":{}}Context: {"exception":{}}', array('exception' => object(UnexpectedValueException)))
(/var/www/html/chatbot/service/vendor/laravel/framework/src/Illuminate/Log/Logger.php:184)
at Illuminate\Log\Logger->writeLog('error', 'The stream or file "/var/www/html/chatbot/service/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission deniedThe exception occurred while attempting to log: The stream or file "/var/www/html/chatbot/service/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission deniedThe exception occurred while attempting to log: The stream or file "/var/www/html/chatbot/service/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission deniedThe exception occurred while attempting to log: file_put_contents(/var/www/html/chatbot/service/storage/framework/views/add5d1b4e53f1613ff65f9e75bc2faaa.php): Failed to open stream: Permission deniedContext: {"exception":{}}Context: {"exception":{}}Context: {"exception":{}}', array('exception' => object(UnexpectedValueException)))
(/var/www/html/chatbot/service/vendor/laravel/framework/src/Illuminate/Log/Logger.php:97)
at Illuminate\Log\Logger->error('The stream or file "/var/www/html/chatbot/service/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission deniedThe exception occurred while attempting to log: The stream or file "/var/www/html/chatbot/service/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission deniedThe exception occurred while attempting to log: The stream or file "/var/www/html/chatbot/service/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission deniedThe exception occurred while attempting to log: file_put_contents(/var/www/html/chatbot/service/storage/framework/views/add5d1b4e53f1613ff65f9e75bc2faaa.php): Failed to open stream: Permission deniedContext: {"exception":{}}Context: {"exception":{}}Context: {"exception":{}}', array('exception' => object(UnexpectedValueException)))
(/var/www/html/chatbot/service/vendor/laravel/framework/src/Illuminate/Log/LogManager.php:681)
at Illuminate\Log\LogManager->error('The stream or file "/var/www/html/chatbot/service/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission deniedThe exception occurred while attempting to log: The stream or file "/var/www/html/chatbot/service/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission deniedThe exception occurred while attempting to log: The stream or file "/var/www/html/chatbot/service/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission deniedThe exception occurred while attempting to log: file_put_contents(/var/www/html/chatbot/service/storage/framework/views/add5d1b4e53f1613ff65f9e75bc2faaa.php): Failed to open stream: Permission deniedContext: {"exception":{}}Context: {"exception":{}}Context: {"exception":{}}', array('exception' => object(UnexpectedValueException)))
(/var/www/html/chatbot/service/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php:317)
at Illuminate\Foundation\Exceptions\Handler->reportThrowable(object(UnexpectedValueException))
(/var/www/html/chatbot/service/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php:278)
at Illuminate\Foundation\Exceptions\Handler->report(object(UnexpectedValueException))
(/var/www/html/chatbot/service/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:497)
at Illuminate\Foundation\Http\Kernel->reportException(object(UnexpectedValueException))
(/var/www/html/chatbot/service/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:146)
at Illuminate\Foundation\Http\Kernel->handle(object(Request))
(/var/www/html/chatbot/service/public/index.php:21)
|