diff --git a/Classes/Writer/JsonWriter.php b/Classes/Writer/JsonWriter.php index 5338873..19c9080 100644 --- a/Classes/Writer/JsonWriter.php +++ b/Classes/Writer/JsonWriter.php @@ -59,9 +59,11 @@ public function writeLog(LogRecord $record) $data['request_id'] = $_SERVER['X-REQUEST-ID'] ?? $_SERVER['HTTP_X_REQUEST_ID'] ?? null; } - $stderr = fopen('php://stderr', 'a'); - fwrite($stderr, json_encode($data) . PHP_EOL); - fclose($stderr); + $stderr = @fopen('php://stderr', 'a'); + if ($stderr) { + fwrite($stderr, json_encode($data) . PHP_EOL); + fclose($stderr); + } return $this; }