Write logs during tests to a file.