Trace.axd

Discussion in 'ASP .Net' started by cameron, Feb 12, 2004.

  1. cameron

    cameron Guest

    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
     
    cameron, Feb 12, 2004
    #1
    1. Advertising

  2. cameron

    cameron Guest

    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
    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
    >
     
    cameron, Feb 13, 2004
    #2
    1. Advertising

  3. 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.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:

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

    #Inside IIS & ASP.NET
    http://www.theserverside.net/articles/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
     
    Steven Cheng[MSFT], Feb 14, 2004
    #3
  4. 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
     
    Steven Cheng[MSFT], Feb 17, 2004
    #4
  5. cameron

    cameron Guest

    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
    >
     
    cameron, Feb 17, 2004
    #5
  6. 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.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?


    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.)
     
    Steven Cheng[MSFT], Feb 18, 2004
    #6
  7. 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(DataSet): Void
    ShowRequests(ArrayList): 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
     
    Stephen Oakman, Feb 26, 2004
    #7
  8. 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
    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
     
    Stephen Oakman, Feb 26, 2004
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sally

    Confused about Trace.axd

    Sally, Aug 13, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    331
    Sally
    Aug 13, 2003
  2. Henry

    Trace.axd output log question.

    Henry, Dec 18, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    542
    Henry
    Dec 18, 2003
  3. Jiho Han
    Replies:
    0
    Views:
    557
    Jiho Han
    Aug 22, 2006
  4. =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=

    Adding my messages to the trace.axd trace?

    =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=, Apr 6, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    622
    =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=
    Apr 6, 2007
  5. Chris Newby
    Replies:
    0
    Views:
    801
    Chris Newby
    Jul 28, 2008
Loading...

Share This Page