{"record":{"id":"819bf25d180191c6","repo":"Seldaek/monolog","slug":"errors-while-writing-to-process-s","errorCode":null,"errorMessage":"Errors while writing to process: %s","messagePattern":"Errors while writing to process: (.+?)","errorType":"exception","errorClass":"UnexpectedValueException","httpStatus":null,"severity":"error","filePath":"src/Monolog/Handler/ProcessHandler.php","lineNumber":93,"sourceCode":"        $this->command = $command;\n        $this->cwd = $cwd;\n        $this->timeout = $timeout;\n    }\n\n    /**\n     * Writes the record down to the log of the implementing handler\n     *\n     * @throws \\UnexpectedValueException\n     */\n    protected function write(LogRecord $record): void\n    {\n        $this->ensureProcessIsStarted();\n\n        $this->writeProcessInput($record->formatted);\n\n        $errors = $this->readProcessErrors();\n        if ($errors !== '') {\n            throw new \\UnexpectedValueException(sprintf('Errors while writing to process: %s', $errors));\n        }\n    }\n\n    /**\n     * Makes sure that the process is actually started, and if not, starts it,\n     * assigns the stream pipes, and handles startup errors, if any.\n     */\n    private function ensureProcessIsStarted(): void\n    {\n        if (\\is_resource($this->process) === false) {\n            $this->startProcess();\n\n            $this->handleStartupErrors();\n        }\n    }\n\n    /**\n     * Starts the actual process and sets all streams to non-blocking.","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/Seldaek/monolog/blob/57eb1028342134e701e77c617565d51b6e5a2a53/src/Monolog/Handler/ProcessHandler.php#L75-L111","documentation":"Error \"Errors while writing to process: %s\" thrown in Seldaek/monolog.","triggerScenarios":"Thrown at src/Monolog/Handler/ProcessHandler.php:93 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"57eb1028342134e701e77c617565d51b6e5a2a53","analyzedAt":"2026-08-17T02:36:30.259Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}