title: Email only Errors/Warnings with Microsoft Logging Application Block 3.1.0.0
body: <p>What am I doing wrong?</p>
  
  <p>I'm trying to configure the logging settings to log all events in a database and event viewer  but email only errors and warnings.  Database and Event Viewer part works fine except that I'm not getting any email for errors. Am I missing something?</p>
  
  <blockquote>
    <p>Note: There isn't any problem with
    smtp settings because I get event's
    emails if I add the listener to
    "General" and "All events" in category
    sources.</p>
  </blockquote>
  
  <p>Here is my config:  (I'm using Microsoft.Practices.EnterpriseLibrary.Logging 3.1.0.0)</p>
  
  <pre><code>    &lt;loggingConfiguration name="Logging Application Block" tracingEnabled="true" defaultCategory="General" logWarningsWhenNoCategoriesMatch="false"&gt;
      &lt;listeners&gt;
        &lt;add databaseInstanceName="LOGGING_DB" writeLogStoredProcName="WriteLog"
                addCategoryStoredProcName="AddCategory" formatter="Text Formatter"
                listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Database.Configuration.FormattedDatabaseTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
                traceOutputOptions="None" type="Microsoft.Practices.EnterpriseLibrary.Logging.Database.FormattedDatabaseTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
                name="Database Trace Listener" /&gt;
  
        &lt;add toAddress="jafet@jafet.com" fromAddress="jafet@jafet.com" subjectLineStarter="My App" subjectLineEnder="QA" smtpServer="SMTP1.jafet.com" smtpPort="25" formatter="Text Formatter" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.EmailTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" traceOutputOptions="None" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.EmailTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" name="Email TraceListener"/&gt;
        &lt;add source="My Application" formatter="Text Formatter" log="" machineName="." listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FormattedEventLogTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" traceOutputOptions="None" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FormattedEventLogTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" name="Event Log Destination"/&gt;
      &lt;/listeners&gt;
      &lt;formatters&gt;
        &lt;add template="Timestamp: {timestamp}&amp;#xA;Message: {message}&amp;#xA;Category: {category}&amp;#xA;Priority: {priority}&amp;#xA;EventId: {eventid}&amp;#xA;Severity: {severity}&amp;#xA;Title:{title}&amp;#xA;Machine: {machine}&amp;#xA;Application Domain: {appDomain}&amp;#xA;Process Id: {processId}&amp;#xA;Process Name: {processName}&amp;#xA;Win32 Thread Id: {win32ThreadId}&amp;#xA;Thread Name: {threadName}&amp;#xA;Extended Properties: {dictionary({key} - {value}&amp;#xA;)}" type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 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 Destination"/&gt;
            &lt;add name="Database Trace Listener" /&gt;
          &lt;/listeners&gt;
        &lt;/add&gt;
      &lt;/categorySources&gt;
      &lt;specialSources&gt;
        &lt;allEvents switchValue="All" name="All Events"&gt;
          &lt;listeners&gt;
            &lt;add name="Event Log Destination"/&gt;
            &lt;add name="Database Trace Listener" /&gt;
          &lt;/listeners&gt;
        &lt;/allEvents&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="Database Trace Listener" /&gt;
            &lt;add name="Event Log Destination"/&gt;
            &lt;add name="Email TraceListener"/&gt;
          &lt;/listeners&gt;
        &lt;/errors&gt;
      &lt;/specialSources&gt;
    &lt;/loggingConfiguration&gt;
  </code></pre>