Does anyone see anything wrong here? I'm trying to set the trace output options to TimeStamp so that my debug messages print out a timestamp along with the message.
here is how I initialise the trace listener.
StreamWriter sw = new StreamWriter System.Windows.Forms.Application.StartupPath + "\\BackupDebug.log", true);
sw.AutoFlush = true;
TextWriterTraceListener textWriter = new TextWriterTraceListener(sw);
textWriter.Name = "OutputDebug";
textWriter.TraceOutputOptions |= TraceOptions.Timestamp;
System.Diagnostics.Debug.Listeners.Add(textWriter);
Then if I make a call to;
System.Diagnostics.Debug.WriteLine("some text");
The text is written to the file "BackupDebug.log" but I get no timestamp with it. I've tried with various other options, but again no luck.
Pete.
here is how I initialise the trace listener.
StreamWriter sw = new StreamWriter System.Windows.Forms.Application.StartupPath + "\\BackupDebug.log", true);
sw.AutoFlush = true;
TextWriterTraceListener textWriter = new TextWriterTraceListener(sw);
textWriter.Name = "OutputDebug";
textWriter.TraceOutputOptions |= TraceOptions.Timestamp;
System.Diagnostics.Debug.Listeners.Add(textWriter);
Then if I make a call to;
System.Diagnostics.Debug.WriteLine("some text");
The text is written to the file "BackupDebug.log" but I get no timestamp with it. I've tried with various other options, but again no luck.
Pete.