473,397 Members | 1,969 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

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

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
1 2913
Same for Debug.Write() for me...

Apr 20 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Alex | last post by:
Hi, I have noticed that I can only see the output of "system.diagnostics.trace.write(..)" in the output window of the dubugger. which leaves me wondering, if these statements are left in the...
4
by: A.M | last post by:
Hi, If I use System.Diagnostics.Debug.WriteLine in a asp.net application, where does the output go? Is there any trace monitor application thar shows me the trace output? Thanks, Allan
1
by: Jiho Han | last post by:
I am wondering whether asp.net applications can write trace information using the System.Diagnostics.Trace class, and also whether in web.config, the <system.diagnostics> element and its sub...
4
by: Jiho Han | last post by:
I have the following defined in web.config under <configuration> node: <system.diagnostics> <switches> <add name="MainSwitch" value="4"/> </switches>
1
by: Patrick | last post by:
When Tracing in ASP.NET, the IIS process (on IIs5.1) is locking on the Trace file, and I can't read the trace file without restarting the IIS: Even the following does NOT work (how could I fix...
0
by: cesporma | last post by:
Hello - I have created a web service using VS.NET 2005 and using the System.Diagnostics tracing to write to a file. This all works great in my development environment. Once I publish the web...
12
by: Zytan | last post by:
I use System.Diagnostics.StackTrace to get the stack trace of the current function, to print out the function's name to the log, and sometimes it shows that a function that doesn't even write to...
0
by: =?Utf-8?B?QWxleA==?= | last post by:
Hi. Does anybody know if System.Diagnostics.TraceSource is supported under ASP.NET? I've used this class along with SourceSwitch and TextWriterTraceListener in Windows apps but this is the first...
0
by: =?Utf-8?B?ZG90TmV0RGF2ZQ==?= | last post by:
I'm wondering why this line: System.Diagnostics.Trace.WriteLine("Some Text"); Does not work in C# in an ASP.NET application? While this one does: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.