willem
willem

Reputation: 27027

Why does asp.net tracing only work from time to time?

ASP.NET tracing seems very erratic. Sometimes it traces and sometimes it doesn't.

I trace from my ASCX using...

Trace.Write("etc. etc.");

My web.config looks as follows... (in WSS3) I first ensure that SharePoint allows the page level tracing...

<SafeMode MaxControls="200" CallStack="true" DirectFileDependencies="10" TotalFileDependencies="50" AllowPageLevelTrace="true">

Here's my ASP.NET trace element...

<trace enabled="true" localOnly="false" pageOutput="true" writeToDiagnosticsTrace="true" />

And my System.Diagnostics trace...

<system.diagnostics>
<trace autoflush="true" indentsize="4" >
    <listeners>
        <add name="listen" type="System.Diagnostics.TextWriterTraceListener" initializeData="c:\asptrace\log.txt" />
        <add name="listen2" type="System.Web.WebPageTraceListener, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"  />
    </listeners>
</trace>

Anything obvious I'm missing?

Upvotes: 3

Views: 975

Answers (1)

kͩeͣmͮpͥ ͩ
kͩeͣmͮpͥ ͩ

Reputation: 7846

Have you checked the request limit in your web.config? It's set to 10 by default, which means you'll only get trace output of the first 10 requests after the application starts.

<trace enabled="false" requestLimit="10" />

Upvotes: 9

Related Questions