By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,199 Members | 1,474 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,199 IT Pros & Developers. It's quick & easy.

System.Diagnostics.Trace.Write() doesn't work in ASP.NET apps

P: n/a
Hi there,

My ASP.NET 2.0 app uses an external assembly that calls methods like
Trace.Write() and Trace.TraceError() of namespace System.Diagnostics.
I need to enable tracing in my web app so that I could see the trace
messages from the component.

Here's what I've added to web.config so far:

<system.web>
<trace writeToDiagnosticsTrace="true"/>
......
</system.web>
<system.diagnostics>
<switches>
<add name="GS.Pwm.Crm" value="4"/>
<add name="Test Log" value="4"/>
</switches>
<trace autoflush="true">
<listeners>
<add name="WebPageTraceListener"
type="System.Web.WebPageTraceListener,
System.Web, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a"/>
<add name="Test Log"
type="System.Diagnostics.TextWriterTraceListener,
System, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089" traceOutputOptions="Callstack"
initializeData="C:\test\test.log" />
<add name="GS.Pwm.Crm"
type="System.Diagnostics.EventLogTraceListener,
System, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"
initializeData="Application" />
</listeners>
</trace>
</system.diagnostics>
If I look into c:\test\test.log or the event log, I'll see the standard
ASP.NET trace messages, e.g.

aspx.page: Begin PreInit
aspx.page: End PreInit
aspx.page: Begin Init
However, there is no output from any Trace.Write() methods.
Even if I put a Trace.Write inside Page_Load() of one of my pages, it
has no effect.

Your help is greatly appreciated.

-Oleg.

Apr 20 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Same for Debug.Write() for me...

Apr 20 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.