473,396 Members | 2,098 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

application level error catch

Is there a straight forward way to tell .net to log any unhandled errors in
the application log. I am catching and logging in certain locations but its
the surprise errors that I need to log the information from. I know how to
log using a try-catch block but i need something for any unforseen error
since my users do not report the description and location correctly.

Thanks for any help.
Oct 26 '05 #1
4 1501
You could use Application_Error. See :
http://support.microsoft.com/default...22120121120120
--
Patrice

"tjfdownsouth" <tj**********@discussions.microsoft.com> a écrit dans le
message de news:B3**********************************@microsof t.com...
Is there a straight forward way to tell .net to log any unhandled errors in the application log. I am catching and logging in certain locations but its the surprise errors that I need to log the information from. I know how to log using a try-catch block but i need something for any unforseen error
since my users do not report the description and location correctly.

Thanks for any help.

Oct 26 '05 #2
Thanks Patrice, but I am using a windows application not a web app. I
thought any errors not handled would get written to the event viewer but they
do not. For instance at some random place I get a connection timeout or an
input error, etc. I would like to be able to record that somewhere.

Thanks

"Patrice" wrote:
You could use Application_Error. See :
http://support.microsoft.com/default...22120121120120
--
Patrice

"tjfdownsouth" <tj**********@discussions.microsoft.com> a écrit dans le
message de news:B3**********************************@microsof t.com...
Is there a straight forward way to tell .net to log any unhandled errors

in
the application log. I am catching and logging in certain locations but

its
the surprise errors that I need to log the information from. I know how

to
log using a try-catch block but i need something for any unforseen error
since my users do not report the description and location correctly.

Thanks for any help.


Oct 27 '05 #3
Oups sorry...

I started few weeks ago my first .NET Windows application and I'm using the
Application.ThreadException event :
http://msdn.microsoft.com/library/de...ptiontopic.asp

--
Patrice

"tjfdownsouth" <tj**********@discussions.microsoft.com> a écrit dans le
message de news:67**********************************@microsof t.com...
Thanks Patrice, but I am using a windows application not a web app. I
thought any errors not handled would get written to the event viewer but they do not. For instance at some random place I get a connection timeout or an input error, etc. I would like to be able to record that somewhere.

Thanks

"Patrice" wrote:
You could use Application_Error. See :
http://support.microsoft.com/default...22120121120120

--
Patrice

"tjfdownsouth" <tj**********@discussions.microsoft.com> a écrit dans le
message de news:B3**********************************@microsof t.com...
Is there a straight forward way to tell .net to log any unhandled errors
in
the application log. I am catching and logging in certain locations
but its
the surprise errors that I need to log the information from. I know
how to
log using a try-catch block but i need something for any unforseen

error since my users do not report the description and location correctly.

Thanks for any help.


Oct 27 '05 #4
Subscribe to the Appdomain.UnhandledException event and log it from there.
If you do not handle it then you get the default behavior of the runtime,
which does not log it. For a windows app or asp.net you will also need to
subscribe to the Application.ThreadException and the
Web.HttpApplication.Error event to get all exceptions.

In general you should write the code so you never get a UE. In the shipping
version of the runtime (v1.1) a UE does not cause the app to terminate; in
future versions the app will terminate after a UE has been processed.

"tjfdownsouth" <tj**********@discussions.microsoft.com> wrote in message
news:B3**********************************@microsof t.com...
Is there a straight forward way to tell .net to log any unhandled errors
in
the application log. I am catching and logging in certain locations but
its
the surprise errors that I need to log the information from. I know how
to
log using a try-catch block but i need something for any unforseen error
since my users do not report the description and location correctly.

Thanks for any help.

Oct 28 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Marc Robitaille | last post by:
hello, How can I have the path of my web application from the global.asax.vb ? I need the path because I have to create an xml file when the application start. thank you Marc R.
5
by: Jason MacKenzie | last post by:
I have a production critical windows forms application. I have try catch blocks everywhere to handle every eventuality. However occasionally, every couple of months, the application crashes. Its...
2
by: Lucas Tam | last post by:
Without writing try/catch statements is there a way to have a global error handler in VB.NET? In ASP.NET there is an application level error handler inside Global.asax, but is there something...
5
by: | last post by:
I've created a small vb.net application which uses the Data Access Application Block to access a SQL Server 2000 database. The application works fine on the machine with the development...
1
by: metsys | last post by:
We have an ASP.NET 2.0 (C#) application that is divided into multiple layers. The multiple layers come from having a web project and 2 different class library projects in the same solution. I'm...
8
by: Rob Meade | last post by:
Hi all, Ok - typically, in a function that returns as a boolean, if there's a bit of database action going on I'll have a little tidy up process before exiting the function. I know .net is...
4
by: David Lozzi | last post by:
Howdy, I found a nice little book called ASP.NET 2.0 Cookbook by Michael A Kittel and Geoffrey LeBlond. Anyway, they have some instructions on how to setup application level error handling. Most...
0
by: David Lozzi | last post by:
Howdy, I'm working on some error handling for my application. Currently on WinXP Pro SP2. Basically this is what I'm doing: Try...Catch at the method level, Catch sends email with error ...
4
by: dave m | last post by:
I'm creating a class library (dll) and am confused as how to pass any information, should any exceptions occur, back to the calling application. Such as: Try x = 3 / 0 ' divide by 0 error...
25
by: JJ | last post by:
I only want to catch 404 errors at the application level (the rest are will be handled by the customerrors section of the web.config). How do I check for the error code in the Application_Error...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.