<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Snipplr</title>
    <description>Recent snippets posted on Snipplr.com</description>
    <link>https://snipplr.com/</link>
    <lastBuildDate>Wed, 10 Jun 2026 03:26:24 +0000</lastBuildDate>
    <item>
      <title>(Visual Basic) Exception Logging to the Event Log - Saikou</title>
      <link>https://snipplr.com/view/4254/exception-logging-to-the-event-log</link>
      <description>&lt;p&gt;A helper class which adds the ability to log exceptions to the Windows event log, including the class and method in which they occurred, to a class that derives from it.&#13;
The event source name defaults to the application title, but can be overridden by passing a string to the constructor (i.e. MyBase.New("MyApp") in the derived class).&#13;
&#13;
e.g.&#13;
&#13;
Public Class Test&#13;
    Inherits ExceptionLogger&#13;
&#13;
    Public Sub Test()&#13;
        Try&#13;
            Throw New ApplicationException("Test exception", New Exception("Test inner exception"))&#13;
        Catch ex As Exception&#13;
            LogException(ex)&#13;
        End Try&#13;
    End Sub&#13;
End Class&lt;/p&gt;</description>
      <pubDate>Mon, 03 Dec 2007 09:40:15 UTC</pubDate>
      <guid>https://snipplr.com/view/4254/exception-logging-to-the-event-log</guid>
    </item>
  </channel>
</rss>
