Debug output

  • Thread starter Thread starter ablyplus
  • Start date Start date
A

ablyplus

Is possible to get debug output to file, and if yes how?

Thanks in advance :)
 
Hi,

Have you use the tracelisteners ? you can use the debug and the trace
associated to the eventlog or any stream (including filestream).

System.Diagnostics;

TextWriterTraceListener Lstr = new TextWriterTraceListener(@"C:\Log.txt");
Debug.Listeners.Add(Lstr);
Debug.AutoFlush = true;

Now if you call
Debug.WriteLine("your text");

it will be dumped on the inmediate window and in your file. You can also
apply this to the Trace object.

Hope this helps
Salva
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top