create copies of stdOut and stdErr logs before iterating through, to prevent concurrency errors