Possible Duplicate:
TextWriterTraceListener and trace filenames with GUIDs
I am using System.Diagnostics
to trace the each n every method in my application. Tracing is working fine in the desired log file i.e xyz.log but at the same time multiple log are getting creating with Guidxyz.log.
My application is a powerpoint addin. Tracing will happen as long as user is working on it.
How can I prevent this from happening?
Sample code:
string userDirectoryPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicatio??nData),
UserSettings.GetApplicationSettingsValue("AppFolder"));
string fileName = Path.Combine(Path.Combine(userDirectoryPath,
UserSettings.GetApplicationSettingsValue("LogFolder")), "ICAddInLog.log");
Trace.Listeners.Add(new TextWriterTraceListener(fileName));
Trace.WriteLine(string.Format(
"{0} \r\n\r\n Title: {1} \r\n\r\n Message: {2} \r\n\r\n TimeStamp: {3} \r\n\r\n {4}",
"---------------Tracing-------------------",
title,
logText,
DateTime.Now,
"-----End"));