Trace.Writing in your web applications

tracing

We've talked in the past about debugging your application but if you can't attach a debugger to your website, why not use the ASP.Net Tracing?  This acts very much like a Debug.WriteLine in a Windows application but instead you do Trace.Write.

Since this does have some memory ramifications, you'll have to add in a line to your web.config file under the System.Web section.

<system.web> 
<!-- Add me! -->
    <trace enabled="true" mostRecent="true" pageOutput="true" requestLimit="20" />

Then you just go to your trace.axd file.  So in an example where your application is in “WebSite1” and on your local development box, http://localhost/WebSite1/trace.axd would be where to get this information

Tags:

Follow the Discussion

Comments Closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.