Error handling and tracing has always been a challenge, and many attempts have been made to automate error handling. I have tried various methods in the past, including writing my own error handler, that bolted in after the application had been written.
Being an MVP, we tend to get offers to try products. A couple of months ago, I got just such and invitation from EurekaLog. Being an old cynic, I originally thought 'another product that promises, but fails to deliver' - but I was wrong (don't tell my wife I admitted to being wrong). I downloaded the demo, and bolted it into a Windows forms application, and sure enough, it caught and reported my error. So I decided to take a look at the documentation. You can email yourself errors from your application. The email contains the error log containing a trace of your application, leading to the error, and optionally a screen shot of what was happening at the time. You can get it to fill in bug reports on Firebugs and Biaxial. Best of all it does this 'without code changes'. This is not strictly true, it adds 1 line to your application - and this it will do automatically. The product also contains a 'log file analyzer'. In addition to seeing your call stack, you can see which processes were running on the system, which modules were loaded, user details, system details and much more. ASP.Net application are also supported.
Now, for the best bit, for mobile developers - we have not been forgotten! .Net CF is supported, including emailing of logs. Obviously due to the limitations of the compact framework, you don't get as much as in the full framework, but it works really well. To test it out, I knocked up a small program to create an error part way through running. The sample shown is in VB, but C# (and Delphi) are also supported. The code was:-
I then deployed the application to the emulator.
Click on the 'Test My Error' button to generate the error, and EurekaLog kicks in for you.
Click on the 'View error report' to get more details....
Click on 'Send Error report', and the application opens a mail message, and adds your error log to it automatically. All your user has to do is send the email (I have a request in to the developer to make this happen automatically, as in the desktop version).
That is all there is to it. The code for EurekaLog is added automatically to your 'Sub Main' (or Sub Main is created if you don't have one!). The code added to your program is:-
For mobile developers, whose applications are generally remote, this is a great addition to our armory. Using EurekaLog along with the excellent MobiControl allows you to get details of your error, fix it, and deploy it remotely, all without leaving the comfort of your office chair.
I heartily recommend this tool as it addresses a real world problem, and solves it in an unobtrusive way. The support from the developers is excellent, and for a relatively small outlay, you get a product that will support Windows Forms applications, ASP.Net AND .Net Compact framework.
There is a 30 day trial you can download here, and the price of the full product is very reasonable. Give it a try - it may save your bacon!
Originally posted 8/Feb/2010