Tracing Enhancement in ASP.NET 2.0 - MostRecent

Back in June 2003 I posted a wish for wrapping in ASP.NET the Trace stack:

The NT Event Log "Wrapping" feature is really handy - it would be great if the Trace log had that. Right now, it fills up with 10 entries and just stops. Yeah, you can change the number of entries, but it would be cool if you could tell it to just keep the last 10 entries.

It looks like my wish has been granted with the  MostRecent attribute for tracing in ASP.NET 2.0:

In ASP.NET 1.x, if the requestLimit exceeds, it will stop collecting trace messages in trace store unless until you clear trace store or restart that application appdomain. Now the Trace settings in config file will looks like, 

           <trace
                  enabled="false"
                  localOnly="true"
                  
mostRecent=”true”
                  pageOutput="false"
                  requestLimit="10"
                  traceMode="SortByTime"
            />

When you set this attribute value to true and if the requestLimit values exceeds, Trace store will keep the most recent trace messages in the store and old message are discarded. If you set this attribute value to false, trace store will stop collecting trace message once its requestLimit value exceeds.

[viaTracing Enhancements in ASP.NET 2.0  - Saravana's Blog]

No Comments