Can I redirect tracing to a file



Can I redirect tracing to a file..

Answer / kirti

Yes. The Debug and Trace classes both have a Listeners property, which is a collection of sinks that receive the tracing that you send via Debug.WriteLine and Trace.WriteLine respectively. By default the Listeners collection contains a single sink, which is an

instance of the DefaultTraceListener class. This sends output to the Win32 OutputDebugString() function and also the System.Diagnostics.Debugger.Log() method. This is useful when debugging, but if you're trying to trace a problem at a customer site, redirecting the output to a file is more appropriate. Fortunately, the TextWriterTraceListener class is provided for this purpose.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Dot Net Framework Interview Questions

What is associationset? : Entity framework

0 Answers  


How does the .net framework 3.0 relate to the .net framework 2.0?

0 Answers  


what is mean by type-safe? Please answer me. Advance thanks.

0 Answers   Excel,


i just want to write an exam regarding .net?plz give me information about taking a test?where to pay 4 d exam,exam centre?

0 Answers  


What is Reflection in .NET?

6 Answers   Fiserv, TCS,






What is NonActionAttribute ?

0 Answers   Cognizant,


Can Static Constructor be Overloaded?Justify it?

11 Answers   Infosys,


what do you mean by table-per-type?

0 Answers   Microsoft,


What is entitycontainer? : Entity framework

0 Answers  


I am going for H1B visa interview, I am not having bank statement ,is it neccesary for stamping process? how to handle the,consulate people without that statement ?

2 Answers  


Can I look at the IL for an assembly

1 Answers  


What is meant by domain model?

0 Answers  


Categories