TFS 2010 - TFS Spam Email Notification

Dec 7, 2011 at 1:15 PM

We finally got TFS Spam Email notifications working on our TFS 2010 environment. It seems like emails are being sent intermittently. I wasn't sure if the TFS Spam Service needed to be restarted each night, but I have set that up to restart automatically each night @ 1 AM. Is there anything else that I can check to see why these emails are being sent sporadically? Any help would be greatly appreciated.

Coordinator
Dec 9, 2011 at 10:18 PM

Sorry for the delay.

There shouldn't be any need to restart TFS Spam nightly, I've got it running on two TFS instances where they're only restarted when I have to restart the server for patch installations.

The log file might provide some useful information. If you don't already have it configured, add something like this to your web.config:

...snip...

  <loggingConfiguration name="TfsSpam" tracingEnabled="true" defaultCategory="General" logWarningsWhenNoCategoriesMatch="false">
    <categorySources>
      <add switchValue="Off" name="Verbose">
        <listeners>
          <add name="FileListenerForLogging" />
        </listeners>
      </add>
      <add switchValue="All" name="Information">
        <listeners>
          <add name="FileListenerForLogging" />
        </listeners>
      </add>
      <add switchValue="All" name="Warning">
        <listeners>
          <add name="FileListenerForLogging" />
        </listeners>
      </add>
      <add switchValue="All" name="Error">
        <listeners>
          <add name="FileListenerForLogging" />
        </listeners>
      </add>
      <add switchValue="All" name="Critical">
        <listeners>
          <add name="FileListenerForLogging" />
        </listeners>
      </add>
    </categorySources>

    <listeners>
      <add name="FileListenerForLogging"
           fileName="C:\TFS Spam Logs\TFSSpamService.log"
           formatter="LoggingFormatter"
           rollSizeKB="2048"
           rollFileExistsBehavior="Increment"
           rollInterval="None"
           timeStampPattern="yyyy-MM-dd-HH-mm"
           type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging"
           listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging"
           traceOutputOptions="None" />
    </listeners>

    <formatters>
      <add name="LoggingFormatter"
           type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging"
           template="[{timestamp}]&#x9;[{dictionary({key} - {value})}]&#x9;{category}&#x9;{processId}&#x9;{win32ThreadId}&#x9;{message}"/>
    </formatters>

    <specialSources>
      <notProcessed switchValue="All" name="Unprocessed">
        <listeners>
          <add name="FileListenerForLogging" />
        </listeners>
      </notProcessed>

      <allEvents switchValue="All" name="All Events" />
      <errors switchValue="All" name="Logging Errors &amp; Warnings" />
    </specialSources>
  </loggingConfiguration>

... snip ...

The notification frequency will also depend on how often TFS is configured to send out notifications. See this blog post for more information: http://blogs.msdn.com/b/chrisid/archive/2010/03/05/faster-delivery-of-notifications.aspx

/Mats

Dec 15, 2011 at 3:22 PM

Thanks for the reply!!  I did as you said with the log.  It does not seem like email is at fault.  The log is not picking up all the changes for some reason.  Is there some sort of setting or notification setting?  The ones that are being sent are captured in the log, the ones that are not logged, do not get notifications.

Dec 15, 2011 at 4:25 PM

By the way, what would be the reason why it would pick up a commit and why it would pick up another commit.  Is there a way I can check a setting??  Thanks for any help that can be provided.