473,734 Members | 2,511 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trace.axd

I have a bunch of custom error handling, (page and application), and
when an error occurs I get it to email me the error, the form data, the
querystring data, the cookie data and the Server variables.This data is
great and has helped solve a lot of bugs but I would also like the trace
information, (i.e. trace.axd), from the current request. Does anyone
know how to get that information in code, (c#), so that I could attach
it to my email?

Thanks

-Cam

Nov 18 '05 #1
7 4479
Ok, lets tackle this from a different angle then. If I can't get that
info into my error handler, I should be able to inherit from the
existing System.Web.Hand lers.TraceHandl er/write my own and then send
emails from there if an error has occured, (as soon as I see something
with a system exception written as a warn I know I have encountered an
error).

Rajiv. R said there is no documentation on this object but that it pull
information from the stack - I guess I can assume that no one really
knows how it does that either?

-Cam

cameron wrote:
I have a bunch of custom error handling, (page and application), and
when an error occurs I get it to email me the error, the form data, the
querystring data, the cookie data and the Server variables.This data is
great and has helped solve a lot of bugs but I would also like the trace
information, (i.e. trace.axd), from the current request. Does anyone
know how to get that information in code, (c#), so that I could attach
it to my email?

Thanks

-Cam


Nov 18 '05 #2
Hi Cam,
Thanks for your followup. Yes, as Rajiv. R has mentioned that the trace.axd
is actually processed by the Trace HttpHandler which is a buildin component
in ASP.NET and the System.Web.Hand lers.TraceHandl er class doestn't expose
public interface for developer to manually retrieve some certain internal
datas. Since you're trying to manually
provide a custom handler derived from it, here are some tech refrerece on
developing ASP.NET httphandlers:

#Exploring ASP.NET Session State and Cache data
http://www.codeproject.com/aspnet/ex...onandcache.asp

#Inside IIS & ASP.NET
http://www.theserverside.net/article...aspx?l=IIS_ASP

# Extending ASP.NET with HttpHandlers and HttpModules
http://www.devx.com/dotnet/Article/6962/0/page/3

Hope they're helpful.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #3
Hi Cam,
Have you had a chance to check out the infos I provided in my former reply
or have you got any progess on this problem? If you need any assitance,
please feel free to post here.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #4
Yes I checked them out. But since none of them cover how to retrieve the
trace information, they are of very little use to me.

-Cam

Steven Cheng[MSFT] wrote:
Hi Cam,
Have you had a chance to check out the infos I provided in my former reply
or have you got any progess on this problem? If you need any assitance,
please feel free to post here.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx


Nov 18 '05 #5
Hi Cam,

Thank you for the followup. Since you are focus on getting the trace info,
I'm afraid the only means maybe to provide a custom tracehandler which
derived from the System.Web.Hand lers.TraceHandl er as you mentioned in the
former message. However, I found that this class is undocumented in MSDN or
somewhere else. Have you had any progress on this means?
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security(This posting is provided "AS IS",
with no warranties, and confers no rights.)

Nov 18 '05 #6
I've just been looking at customizing the trace.axd output and have
hit the same brick wall. I was hoping trace.axd output just straight
xml and that there was a stylesheet that rendered this data and that I
could find the location of this stylesheet and modify it. No joy
there.

The output of the tracehandler is straight html and after using .net
reflector there's a private const that holds the css so it's nicely
hardcoded into the handler. Nice.

There are two protected methods that you should be able to override if
you inherit from this class. These are:

ShowDetails(Dat aSet): Void
ShowRequests(Ar rayList): Void

I haven't made any attempt to inherit from this class yet but I would
hope that the DataSet passed in to ShowDetails contains the data we're
all after.

When I get the time I'm planning on trying to tackle this and creating
a generic class that outputs the trace via trace.axd as raw xml and
that this can then be transformed however you like. If I manage to
succeed in this then I'll make it freely and publicly available.

I hope this helps in some way.

Cheers

+Steve
Nov 18 '05 #7
Have now done a bit more digging on this. The 2 methods I was going to
override aren't marked as virtual ect - so can't override.

Have now run a decompiler over System.Web.dll and have now found where
it get's it's data from. The call is within ProcessRequest of the
TraceHandler and is HttpRuntime.Pro file.GetData() which returns an
arraylist with each index being the details of a request held as a
dataset. The list is reset by calling HttpRuntime.Pro file.Reset()
which clears the trace list.

I'm just digging for more details but it looks like this
HttpRuntime.Pro file is hidden and again undocumented but at least I'm
getting somewhere.

Hopefully the next time you hear from me it will be to give a link to
where you can download the custom trace handler and full documentation
on it's use.

Cheers

+Steve
Nov 18 '05 #8

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

Similar topics

2
2383
by: Ken | last post by:
I would like to start using EventLogTraceListener, and am running into a couple of significant limitations: 1) I have found that there is no way to write EventLog entries with different EventLogEntryTypes. It seems that EventLogTraceListener is only capable of writing entries with EventLogEventType.Informat­ion, even for Trace.Fail. Is this assessment correct? 2) EventLogTraceListener.Flush (and the idea of buffering writes) is not...
9
2994
by: svenn.are | last post by:
Hi, has anybody thought of / already used graphviz to convert the output of trace.py into a graph? I looked at PyUMLGraph, but 1. PyUMLGraph does not successfully create a dot file, and 2. I don't really want a UML representation but a compact representation of program execution. Maybe there is some other tool that I am not aware of which can create this kind of trace. I use eclipse with pydev plugin on MacOS 10.3.9
2
6128
by: Wilfried Hoermann | last post by:
Presumably a trivial question... I want to write trace information from a web service to a log file using the Trace Class. Is this possible without closing and opening the Trace in every single web method? Code: public Webservice() System.IO.FileStream ts = new System.IO.FileStream(traceFile,System.IO.FileMode.Append); Trace.Listeners.Remove
5
2228
by: martin | last post by:
Hi, The trace class seems to me to be very usefull however there are a few features of it that have to confused. I am using visual studio 2003. the IDE will not let me write trace.assert(..) or trace.writeLine(..) or trace.writeif(..)
3
1934
by: JR | last post by:
I'm experiencing a problem where, for seemingly no reason, trace output stops being logged (and appearing on my pages.) trace.enabled suddenly just turns to false. Any idea why this happens? It actually is happening on 2 machines I work on. Thanks.
5
2934
by: who be dat? | last post by:
Hello all. I'm writing an application that is writing trace information that can be viewed in trace.axd. I would like to rename this and use a different name specific to my application. I know the name of this is set in machine.config. I was hoping it would be possible to change this in web.config. I got it to work, kind of. Good news is I can change the name in my web.config file. Bad news is that trace.axd still works meaning I can...
5
518
by: cameron | last post by:
I have attempted to lock down the trace.axd file with the standard: <location path="trace.axd"> <system.web> <authorization> <allow roles="SOME GROUP"/> <deny users="*"/> </authorization> </system.web> </location>
9
4438
by: Joe Rattz | last post by:
I can't seem to get to trace.axd. I have turned tracing on in web.config. Here is how I currently have i configured: <trace enabled="true" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="false" />
1
4369
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 this??): System.Diagnostics.Trace.WriteLine(System.DateTime.Now.ToLongTimeString()+ "--" + dirException.ToString()); System.Diagnostics.Trace.Flush(); ((System.Diagnostics.TraceListener) System.Diagnostics.Trace.Listeners).Close();
3
2869
by: Arman Sahakyan | last post by:
Hi, I'm an MFC programmer and know little about .NET programming. Now, for some reasons, I'm developing an ASP .NET application... What I need to know is how to output into VS's Output Window like what MFC's TRACE macro does (during debugging). Could you please share your knowledge with me? Thanks in advance.
0
8946
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8776
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
9310
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9236
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
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
6735
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
6031
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.