I'm looking for a good framework for tracing activities in asp.net MVC. I've implemented registration to action filters with in ActionFilterAttribute. But I want to have see all activities like WCF tracing offers. Since the operation is posting to service , I want it to be traced to file like tracing in WCF.
10x, Rony
Tracing is used to follow the path of the execution page. It displays the diagnostic information of the the execution page at run time. It is used to debug the application. It can be integrated with the system level tracing that provides multiple levels of tracing.
Tracing in Web API uses a facade pattern: When tracing is enabled, Web API wraps various parts of the request pipeline with classes that perform trace calls.
Trace can be a useful tool for logging and debugging, and sometimes it would be handy to be able to call one of the tracing methods from a Razor view. For example, when an MVC application runs in production, by default MVC catches most application exceptions for you and routes them to Views/Shared/Error. cshtml.
To enable tracing for an applicationAdd a trace element as a child of the system. web element. In the trace element, set the enabled attribute to true. If you want trace information to appear at the end of the page that it is associated with, set the trace element's pageOutput attribute to true.
For now I found a nice thing.
<system.diagnostics>
<trace autoflush="true">
<listeners>
<add name="textLogListener" type="System.Diagnostics.TextWriterTraceListener"
initializeData="app.log" />
<remove name="Default" />
</listeners>
</trace>
</system.diagnostics>
Check out Glimpse. Glimpse is an easy way to view tracing activities.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With