title: Exception Handling Application Block not writing to Event Log
body: <p>I am trying to configure Exception Handling Application Block to write exceptions to Event Log.</p>
  
  <p>I have created the following configuration:</p>
  
  <pre><code>&lt;exceptionHandling&gt;
      &lt;exceptionPolicies&gt;
          &lt;add name="Default"&gt;
              &lt;exceptionTypes&gt;
                  &lt;add name="All Exceptions"
                       type="System.Exception, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
                       postHandlingAction="NotifyRethrow"&gt;
                      &lt;exceptionHandlers&gt;
                          &lt;add name="Logging Exception Handler"
                               type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                               logCategory="General"
                               eventId="100"
                               severity="Error"
                               title="Enterprise Library Exception Handling"
                               formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling"
                               priority="0" /&gt;
                      &lt;/exceptionHandlers&gt;
                  &lt;/add&gt;
              &lt;/exceptionTypes&gt;
          &lt;/add&gt;
      &lt;/exceptionPolicies&gt;
  &lt;/exceptionHandling&gt;
  
  &lt;loggingConfiguration name="Default"
                        tracingEnabled="true"
                        defaultCategory="General"&gt;
      &lt;listeners&gt;
          &lt;add name="Event Log Listener"
               type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FormattedEventLogTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
               listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FormattedEventLogTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
               source="Enterprise Library Logging"
               formatter="Text Formatter"
               log=""
               machineName="."
               traceOutputOptions="None" /&gt;
      &lt;/listeners&gt;
      &lt;formatters&gt;
          &lt;add type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
               template="Timestamp: {timestamp}{newline}&amp;#xA;Message: {message}{newline}&amp;#xA;Category: {category}{newline}&amp;#xA;Priority: {priority}{newline}&amp;#xA;EventId: {eventid}{newline}&amp;#xA;Severity: {severity}{newline}&amp;#xA;Title:{title}{newline}&amp;#xA;Machine: {localMachine}{newline}&amp;#xA;App Domain: {localAppDomain}{newline}&amp;#xA;ProcessId: {localProcessId}{newline}&amp;#xA;Process Name: {localProcessName}{newline}&amp;#xA;Thread Name: {threadName}{newline}&amp;#xA;Win32 ThreadId:{win32ThreadId}{newline}&amp;#xA;Extended Properties: {dictionary({key} - {value}{newline})}"
               name="Text Formatter" /&gt;
      &lt;/formatters&gt;
      &lt;categorySources&gt;
          &lt;add switchValue="All" name="General"&gt;
              &lt;listeners&gt;
                  &lt;add name="Event Log Listener" /&gt;
              &lt;/listeners&gt;
          &lt;/add&gt;
      &lt;/categorySources&gt;
      &lt;specialSources&gt;
          &lt;allEvents switchValue="All" name="All Events" /&gt;
          &lt;notProcessed switchValue="All" name="Unprocessed Category" /&gt;
          &lt;errors switchValue="All" name="Logging Errors &amp;amp; Warnings"&gt;
              &lt;listeners&gt;
                  &lt;add name="Event Log Listener" /&gt;
              &lt;/listeners&gt;
          &lt;/errors&gt;
      &lt;/specialSources&gt;
  &lt;/loggingConfiguration&gt;
  </code></pre>
  
  <p>I have tried testing this configuration using:</p>
  
  <pre><code>ExceptionPolicy.HandleException(new Exception("TEST"), "Default");
  </code></pre>
  
  <p>This code executes without any problems, but nothing is writted to the Event Log.
  I suspect this is simply a configuration error, but I haven't been able to pinpoint what is causing this.</p>
  
  <p>Any suggestions on what could be wrong or how to debug this?</p>