Log Data to a File

Log Data to a File You can easily write a collection of data to a log file by using System.IO.File.WriteAllLines¬†method. The File.WriteAllLines method take two parameters, the output file and a collection of string entries. The method writes each entry on a new line.