title: Enterprise Library 5: Exceptions not being logged to Event log on Windows Azure
body: <p>I have a WCF service that's deployed as a Windows Azure Web Role.</p>
  
  <p>I'm using Enterprise Library for exception handling and in my local Development Fabric, exceptions seem to be handled and logged correctly using the Event Log Handler (logging to the Application event log).</p>
  
  <p>When it's running on Azure, while the Exception Policy seems to be being applied (as I'm observing correct handling of certain expected exceptions), nothing's being logged to the Event Log.</p>
  
  <p>Here's the exception handling policy:</p>
  
  <pre><code>&lt;add name="Entity"&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.414.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;
  </code></pre>
  
  <p>And here's the Logging configuration:</p>
  
  <pre><code> &lt;loggingConfiguration name="" 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.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
            listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FormattedEventLogTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" source="Enterprise Library Logging" formatter="Text Formatter"
            log="Application" 
            machineName="." 
            traceOutputOptions="LogicalOperationStack, DateTime, Timestamp, ProcessId, ThreadId, Callstack" /&gt;
    &lt;/listeners&gt;
    &lt;formatters&gt;
      &lt;add type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.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>Any idea what's going wrong?</p>