|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to raise exception which automatically written to Application event log?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 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 "GS" <n*@no.com> wrote in message news:OqSiJf8EGHA.1148@TK2MSFTNGP10.phx.gbl... 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 Excellent,
Thanks. "Karl Seguin [MVP]" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> wrote in message news:eQMBvm8EGHA.3064@TK2MSFTNGP10.phx.gbl... 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" <n*@no.com> wrote in message news:OqSiJf8EGHA.1148@TK2MSFTNGP10.phx.gbl... 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 |
|||||||||||||||||||||||