Tutorial on Logging Error Information

robertb_NZ

Well-known member
Joined
May 11, 2010
Messages
146
Location
Auckland, New Zealand
Programming Experience
10+
My application starts with a startup form that in normal circumstances is never seen. The startup form includes this code: -

Private Sub Startup_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Try
Dim Workbench As New JazzWorkbench
Workbench.ShowDialog()
Me.Close()​
Catch ex As Exception
lblError.Text = ex.Message
' Want to log diagnostics here​
End Try​
End Sub​

When I'm debugging with VS I can put a checkpoint on the statement lblError.text = ex.message and use VS windows like Call Stack to find out what's wrong.

I also want to handle these errors when the application is deployed (ClickOnce), so I want to be able to log these errors and send a notification to support. Presumably I will use various methods and classes from the System.Diagnostics namespace. Can anybody point me at a tutorial that I should read about this? I've read through the MSDN documentation of the namespace, but it's like reading a dictionary when I want an introductory textbook.

Thank you, Robert
 
Back
Top