Can I redirect tracing to a file

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is Layout in ASP.Net MVC?

577


What is routeconfig.cs in mvc 4?

649


What is the use of the default route {resource}.axd/{*pathinfo} ?

556


What is the meaning of unobtrusive javascript? Explain us by any practical example.

568


What is the need of Action Filters in ASP.Net MVC

571






what is lazy loading in entity framework?

595


Which is the default http method for an action method?

511


What are the 3 main components of an asp.net mvc application?

540


sql related question (outer join, left, right etc) array vs hashtable CRL sqldatareader vs dataset what is WPF, WCF, compare to WinForms Webservices Asp.net MVC vs WebForms?

2964


What is meant by domain model?

545


What is orm entity framework?

525


What is net framework 3.0 ?

595


Is .net framework backwards compatible?

613


What are actions in mvc?

557


why DotNetFramework is included in building a software

2220