Seldaek/monolog · error · InvalidArgumentException
The optional CWD argument must be a non-empty string or null
Error message
The optional CWD argument must be a non-empty string or null.
What it means
Error "The optional CWD argument must be a non-empty string or null." thrown in Seldaek/monolog.
Source
Thrown at src/Monolog/Handler/ProcessHandler.php:70
0 => ['pipe', 'r'], // STDIN is a pipe that the child will read from
1 => ['pipe', 'w'], // STDOUT is a pipe that the child will write to
2 => ['pipe', 'w'], // STDERR is a pipe to catch the any errors
];
/**
* @param string $command Command for the process to start. Absolute paths are recommended,
* especially if you do not use the $cwd parameter.
* @param string|null $cwd "Current working directory" (CWD) for the process to be executed in.
* @param float $timeout The maximum timeout (in seconds) for the stream_select() function.
* @throws \InvalidArgumentException
*/
public function __construct(string $command, int|string|Level $level = Level::Debug, bool $bubble = true, ?string $cwd = null, float $timeout = 1.0)
{
if ($command === '') {
throw new \InvalidArgumentException('The command argument must be a non-empty string.');
}
if ($cwd === '') {
throw new \InvalidArgumentException('The optional CWD argument must be a non-empty string or null.');
}
parent::__construct($level, $bubble);
$this->command = $command;
$this->cwd = $cwd;
$this->timeout = $timeout;
}
/**
* Writes the record down to the log of the implementing handler
*
* @throws \UnexpectedValueException
*/
protected function write(LogRecord $record): void
{
$this->ensureProcessIsStarted();
View on GitHub (pinned to 57eb102834)
When it happens
Trigger: Thrown at src/Monolog/Handler/ProcessHandler.php:70 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of Seldaek/monolog@57eb102834 (2026-08-17).
Data as JSON: /api/errors/110485b308fbc85c.
Report an issue: GitHub.