« Previous Next »

Thread: Global.asax and Application_Error event + Logging to SQL 2005 database.

Last post 06-03-2008 12:31 PM by anilr. 2 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (3 items)

Sort Posts:

  • 06-02-2008, 9:33 PM

    Global.asax and Application_Error event + Logging to SQL 2005 database.

    G'day,

    I'm just looking at the way IIS7 reports Error Pages.  There is an option under "Edit Feature Settings" that has "Detailed errors", which include most of the critical stuff the IT staff would need to resolve issues.

    What is the easy way to use the global.asax page in a .net 2.0 web solutions "Application_Error" event to forward a "Detailed Error" to the software developement or IT management teams? (I'll be emailing it).

    This way a user might see one option, which is set via the IIS Manager application, while the IT support team get forwarded the detailed problem.  Is this the correct way to manage an ASPX application?

    Secondly is it possible to use the IIS7 Logging feature to send all errors to a "Custom" SQL 2005 database?  Does Microsoft supply an example .net solution to fast track this option.

  • 06-03-2008, 2:09 AM In reply to

    Re: Global.asax and Application_Error event + Logging to SQL 2005 database.

    1) I'm not certain you can achieve what you want without some coding.  There is 'no easy way' I can think of using the out of the box error pages w/o wrapping your own.

    2) Here is a sql logging module to do what you want with sql 2005 and logging. http://blogs.iis.net/bills/archive/2007/05/01/building-an-iis7-sql-logging-module-with-net.aspx

    Understand using the sql module pulls the logging out of kernel mode, which can be a perf hit. 

     

    Steve Schofield
    Windows Server MVP - IIS
    http://weblogs.asp.net/steveschofield


    http://www.IISLogs.com
    Log archival solution
    Install, Configure, Forget
  • 06-03-2008, 12:31 PM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 6:13 PM
    • Redmond, WA
    • Posts 2,343

    Re: Global.asax and Application_Error event + Logging to SQL 2005 database.

    You can use failed-request tracing's ability to launch custom exe to launch an executable when the matched failure condition is triggered - you will still need to write the exe/script which would do the e-mail etc action you want to do.

    This is not exposed in the UI - the properties are customActionExe/customActionParams/customActionTriggerLimit in system.webServer/tracing/traceFailedRequests

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
Page 1 of 1 (3 items)
Microsoft Communities