C# function for writing to daily log file upon exception