473,732 Members | 2,175 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting More Tracing Output in ASP.NET App.

We have an ASP.NET 2.0 (C#) app and we're trying to add tracing into it.
The tracing functionality within .NET is great, but when we output this to a
file, it's kind of sparse.

So, we're looking for ideas on how to get more tracing info. output to our
log file than what's currently output by calling the Write methods.
Here are some snippets of what we're thinking of:

Web.config
<system.diagnos tics>
<trace autoflush="true " indentsize="4">
<listeners>
<add name="TextWrite rTraceListener"
type="System.Di agnostics.TextW riterTraceListe ner"
initializeData= "D:\Temp\TraceF iles\Applicatio n_TraceFile.log "/>
</listeners>
</trace>
</system.diagnost ics>

..aspx page
protected void Page_Load(objec t sender, EventArgs e)
{
Trace.Write("We b Application", "Trace test from a web application
(before call to method in class library).");

Tracing.Trace() ; // Call to method in library, to get tracing info.
from a library too

Trace.Write("We b Application", "Trace test from a web application
(after call to method in class library).");
}

..cs class library
public static void Trace()
{
// Just for testing tracing from a library and an ASP.NET app
System.Diagnost ics.Trace.Write Line("Trace test from a class
library (using WriteLine).", "Tracing Class Library");
}

In the tracing log file, we get:

aspx.page: Begin PreInit

....

aspx.page: Begin Load
Web Application: Trace test from a web application (before call to method in
class library).
Tracing Class Library: Trace test from a class library (using WriteLine).
WhoAmI Web Application: Trace test from a web application (after call to
method in class library).
aspx.page: End Load

....

aspx.page: End Render

Is there any way to have the built-in tracing spit out more info. to the
file? For example, if you have tracing turned on to display at the bottom
of the web page, it generates a lot of useful info. Is there any way to get
all that info. logged to a file?

Thank you.

May 11 '06 #1
0 1366

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

Similar topics

2
1699
by: Trace User | last post by:
Hello, I have a design question regarding Tracing and Trace Switches. I understand that Trace Switches can be configured through an application's .config file. When a switch is instantiated, the application automatically checks the configuration file for a matching named switch. If there's a match, the configuration parameters are set.
2
1203
by: Richard | last post by:
Hello, I have a web application where I am doing alot of the work in a separate namespace that isn't part of a web page. I would like to be able to trace into this section of code, but because it's not a 'Page' object the Page.Trace isn't doable. Does anyone have any suggestions as to how I can implement tracing in this separate code? Writing to an output file isn't doable either because our customers will not allow write access to...
2
1239
by: Damon Allison | last post by:
Hello, I am wondering if it is possible to export trace output (via trace.axd or otherwise) to a text file. I would like to search on different requests for certain conditions that are occuring in our code. What I am doing today is using trace.axd and viewing each request by hand and scanning for certain events. Since this particular event only occurs in 1/10 posts, it is tedious to say the least. If I could get the info exported...
6
1661
by: serge calderara | last post by:
Dear all, I have an applicatin that generate a querry to an SQL server, then display results on a second webform. I try to see how tracing works, then I have notice that as soon as I implement tracing on the page, when I click on the BACK button of explorer I get a warning message that information of the page needs to be resend to be displayed ?
2
1764
by: deepukutty | last post by:
Hi all, I know tht we can do tracing in two ways.one in application level and the other is at Page level. I am able to see the details of trace either on the page itself or .../trace.axd page. I want to use maximum out of the available trace details . or let me put it like this.... tell me the actual scenario's where these trace details will be use ful and
1
936
by: Massimo | last post by:
I've got a problem with VB.NET application tracing: together with my tracing messages I see in my output (file or debug window) a lot of rows with only a nu,ber (1, 2, 3, ...) What that means? Is there a way to remove it? Thanks, Max
3
1281
by: asapjim | last post by:
Hi, I have a C# class that is being used by an ASP.net application. How can I include the tracing from the class in the ASP.net application's trace output (trace.axd)?
6
3374
by: Stephen Torri | last post by:
I am trying to produce a singleton class that I can use throughout my library to write tracing information to a file. My intent was to design such that someone using the library in its debug mode would be able to see what was happening without having to use a debugger to step through each instruction. What they would do is run their program and view the tracing file output. If there was something wrong then they would use the debugger of...
1
1718
by: RedLars | last post by:
Hi Does the class System.Diagnostics.Trace use a singelton ? I'm able to do this; System.Diagnostics.Trace.WriteLine("test"); However, these give compiler errors; System.Diagnostics.Trace myTrace = new System.Diagnostics.Trace; // A new expression requires () or
0
8773
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9445
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9180
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6733
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4805
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3259
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2177
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.