public static void AddTraceLog(string fileName) { TextWriterTraceListener tw = new TextWriterTraceListener("c:\\mytrace.log"); System.Diagnostics.Trace.Listeners.Add(tw); }