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?
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.Handlers.TraceHandler/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
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?
> 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 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.Handlers.TraceHandler 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:
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.
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.
> Steven Cheng
> Microsoft Online Support
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> Get Preview at ASP.NET whidbey
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.Handlers.TraceHandler 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?
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
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:
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
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.
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.Profile.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.Profile.Reset()
which clears the trace list.
I'm just digging for more details but it looks like this
HttpRuntime.Profile is hidden and again undocumented but at least I'm
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.