diff --git a/src/Interceptor/LogIntoHttpArchive.php b/src/Interceptor/LogIntoHttpArchive.php index 80d48f2f..3a4d9528 100644 --- a/src/Interceptor/LogIntoHttpArchive.php +++ b/src/Interceptor/LogIntoHttpArchive.php @@ -151,12 +151,18 @@ public function request(Request $request, CancellationToken $cancellation, Deleg public function reset(): Promise { - return call(function () { + return $this->rotate($this->filePath); + } + + public function rotate(string $filePath): Promise + { + return call(function () use ($filePath) { /** @var Lock $lock */ $lock = yield $this->fileMutex->acquire(); // Will automatically reopen and reset the file $this->fileHandle = null; + $this->filePath = $filePath; $this->error = null; $lock->release();