How to raise exception which automatically written to Application event log?

Discussion in 'ASP .Net' started by GS, Jan 7, 2006.

  1. GS

    GS Guest

    I have noticed that ASP.NET 2.0 writes unhandled exceptions automatically to event log. How do I that on purpouse in a code? Say I have hit error condition and would like to abort current thread and throw exception which will be automatically written in event log?

    Thanks,
    G
     
    GS, Jan 7, 2006
    #1
    1. Advertising

  2. Global.asax has an Application_Error event which fires whenever an unhandled exception bubbles up. You can throw a new exception whereever you want and handle it (log it) in that funciton. take a look at:
    http://support.microsoft.com/default.aspx?scid=kb;en-us;306355

    Karl

    --
    http://www.openmymind.net/



    "GS" <> wrote in message news:...
    I have noticed that ASP.NET 2.0 writes unhandled exceptions automatically to event log. How do I that on purpouse in a code? Say I have hit error condition and would like to abort current thread and throw exception which will be automatically written in event log?

    Thanks,
    G
     
    Karl Seguin [MVP], Jan 7, 2006
    #2
    1. Advertising

  3. GS

    GS Guest

    Excellent,

    Thanks.
    "Karl Seguin [MVP]" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> wrote in message news:...
    Global.asax has an Application_Error event which fires whenever an unhandled exception bubbles up. You can throw a new exception whereever you want and handle it (log it) in that funciton. take a look at:
    http://support.microsoft.com/default.aspx?scid=kb;en-us;306355

    Karl

    --
    http://www.openmymind.net/



    "GS" <> wrote in message news:...
    I have noticed that ASP.NET 2.0 writes unhandled exceptions automatically to event log. How do I that on purpouse in a code? Say I have hit error condition and would like to abort current thread and throw exception which will be automatically written in event log?

    Thanks,
    G
     
    GS, Jan 7, 2006
    #3
    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. =?Utf-8?B?VG9tIFdpbmdlcnQ=?=

    My.Log.Writeexception not writing to Application Event Log.

    =?Utf-8?B?VG9tIFdpbmdlcnQ=?=, Jan 20, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    2,417
    =?Utf-8?B?VG9tIFdpbmdlcnQ=?=
    Jan 20, 2006
  2. Jacol

    raise or not to raise [Newbie]

    Jacol, Feb 3, 2007, in forum: Python
    Replies:
    5
    Views:
    437
    Gabriel Genellina
    Feb 5, 2007
  3. ernest
    Replies:
    2
    Views:
    312
    Roy Smith
    Nov 14, 2010
  4. Jack Bates
    Replies:
    0
    Views:
    297
    Jack Bates
    May 2, 2011
  5. bvdp

    Raise X or Raise X()?

    bvdp, Mar 11, 2012, in forum: Python
    Replies:
    10
    Views:
    409
    Stefan Behnel
    Mar 12, 2012
Loading...

Share This Page