Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to raise exception which automatically written to Application event log?

Reply
Thread Tools

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

 
 
GS
Guest
Posts: n/a
 
      01-07-2006
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
 
Reply With Quote
 
 
 
 
Karl Seguin [MVP]
Guest
Posts: n/a
 
      01-07-2006
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...b;en-us;306355

Karl

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



"GS" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
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
 
Reply With Quote
 
 
 
 
GS
Guest
Posts: n/a
 
      01-07-2006
Excellent,

Thanks.
"Karl Seguin [MVP]" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> wrote in message news:(E-Mail Removed)...
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...b;en-us;306355

Karl

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



"GS" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Raise X or Raise X()? bvdp Python 10 03-12-2012 04:08 PM
"raise (type, value, traceback)" and "raise type, value, traceback" Jack Bates Python 0 05-02-2011 05:23 PM
raise Exception or raise Exception() ernest Python 2 11-14-2010 08:14 PM
raise or not to raise [Newbie] Jacol Python 5 02-05-2007 11:46 PM
method for Exception base class to raise the exception in an expression? Bengt Richter Python 0 07-07-2005 05:07 PM



Advertisments