What is tracing?Where it used.Explain few methods available

Answer Posted / kirti

Tracing refers to collecting information about the application while it is running. You use tracing information to troubleshoot an application.

Tracing allows us to observe and correct programming errors. Tracing enables you to record information in various log files about the errors that might occur at run time. You can analyze these log files to find the cause of the errors.

In .NET we have objects called Trace Listeners. A listener is an object that receives the trace output and outputs it somewhere; that somewhere could be a window in your development environment, a file on your hard drive, a Windows Event log, a SQL Server or Oracle database, or any other customized data store.

The System.Diagnostics namespace provides the interfaces, classes, enumerations and structures that are used for tracing The System.Diagnostics namespace provides two classes named Trace and Debug that are used for writing errors and application execution information in logs.

All Trace Listeners have the following functions. Functionality of these functions is same except that the target media for the tracing output is determined by the Trace Listener.

Method Name

Result Fail Outputs the specified text with the Call Stack.

Write Outputs the specified text.

WriteLine Outputs the specified text and a carriage return.

Flush Flushes the output buffer to the target media.

Close Closes the output stream in order to not receive the tracing/debugging output.

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

593


What is entity framework in asp net?

533


What is an asynchronous controller in asp.net mvc?

539


What is the .net framework and how does it work?

557


Why to use “{resource}.axd/{*pathinfo}” in routing in mvc?

562






Can I remove .net framework?

541


Can you explain renderbody and renderpage in mvc?

577


What is web api‘s in asp.net mvc 4 ?

580


What are the advantages of razor view engine?

523


What is model first? : Entity framework

535


Mention two instances where routing is not implemented or required?

743


What are the versions of .net framework?

533


How large is the .net framework 3.0?

553


Explain the difference between Viewbag and Viewdata in ASP.NET MVC?

567


Explain bundle.config in mvc4?

642