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 partialview in asp.net mvc?

0 Answers  


About .NET Framework ?

5 Answers   MMTS,


Iam using an asp.net application . i want to update one of my table in database at 4pm every day how it is possible.

6 Answers   ABC, Evalueserve,


What is the difference between viewbag and viewdata in mvc?

0 Answers  


Is the following route definition a valid route definition? {controller}{action}/{id}

0 Answers   NA,


About Assembly in .NET, types of assemblies, their difference, How to register into GAC. How to generate the strong names & its use ?

6 Answers   Infosys, Microsoft, MMTS,


Why to use '{resource}.axd/{*pathInfo}' in routing in ASP.Net MVC?

0 Answers   B-Ways TecnoSoft,


reading doc file in textbox using .net2005 with c#

3 Answers  


What is shared and private assembly ?

3 Answers   Accenture, BirlaSoft,


mention what are the various methods provided by the dataset object to generate xml?

0 Answers   Microsoft,


What is the use .Glimpse in ASP.Net MVC

0 Answers   B-Ways TecnoSoft,


Changes to which portion of version number indicates an incompatible change

1 Answers  


Categories