Email trace listener not working

Topics: Logging Application Block
Sep 26, 2008 at 2:04 PM
Edited Sep 26, 2008 at 2:12 PM

Guys,

I have the following in my logging config

 

 <loggingConfiguration name="Logging Application Block" tracingEnabled="true"
    defaultCategory="" logWarningsWhenNoCategoriesMatch="true">
    <listeners>
      <add toAddress="ismail.mayat@iasb2b.com" fromAddress="branddialog@iasb2b.com"
        subjectLineStarter="--------------------------" subjectLineEnder="--------------------------"
        smtpServer="127.0.0.1" smtpPort="25" formatter="Text Formatter"
        listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.EmailTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        traceOutputOptions="LogicalOperationStack" filter="Error" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.EmailTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="Email TraceListener" />
      <add fileName="ProfileManagerLogs/profilemanager.log" footer="----------------------------------------"
        formatter="Text Formatter" header="----------------------------------------"
        rollFileExistsBehavior="Increment" rollInterval="Day" rollSizeKB="0"
        timeStampPattern="yyyy-MM-dd" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        traceOutputOptions="Timestamp" filter="All" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="Rolling Flat File Trace Listener" />
    </listeners>
    <formatters>
      <add template="Timestamp: {timestamp} &#xD;&#xA;Message: {message} &#xD;&#xA;Category: {category}&#xD;&#xA;Priority: {priority} &#xD;&#xA;EventId: {eventid} &#xD;&#xA;Severity: {severity} &#xD;&#xA;Title:{title} &#xD;&#xA;Extended Properties: {dictionary({key} - {value}&#xD;&#xA;)}"
        type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="Text Formatter" />
    </formatters>
    <categorySources>
      <add switchValue="All" name="Category">
        <listeners>
          <add name="Rolling Flat File Trace Listener" />
          <add name="Email TraceListener" />
        </listeners>
      </add>
    </categorySources>
    <specialSources>
      <allEvents switchValue="All" name="All Events">
        <listeners>
          <add name="Rolling Flat File Trace Listener" />
        </listeners>
      </allEvents>
      <notProcessed switchValue="All" name="Unprocessed Category">
        <listeners>
          <add name="Email TraceListener" />
          <add name="Rolling Flat File Trace Listener" />
        </listeners>
      </notProcessed>
      <errors switchValue="All" name="Logging Errors &amp; Warnings">
        <listeners>
          <add name="Email TraceListener" />
        </listeners>
      </errors>
    </specialSources>
  </loggingConfiguration>

the file appender works fine but the email one does not send emails. Am i missing something?

Thanks in advance


Ismail

 

 

 

Oct 14, 2008 at 1:20 AM
Hi Ismail,

Do you have a smtp server at your local host? If not, please get one from your network administrator (if there is one setup in your network).

All the best.
Cheers