title: How to log Catch exception to a text file
body: <p>I have a vb.net program that runs a Try Catch.  What i'd like to have happen, if there is an exception is have it log that exception to a text file.  I have:</p>
  
  <pre><code>Catch ex As Exception
                  MsgBox(ex.Message)
                  My.Application.Log.WriteException(ex, TraceEventType.Error, "Exception " &amp; "with argument " &amp; "C:\Log.txt" &amp; ".")
  
              End Try
  </code></pre>
  
  <p>But it's not sending the exception to the logfile.  What am I missing?</p>