Set tracing/logging in Dynamics CRM 2011 E-mail Router

Turn on tracing: Follow below steps to enable E-mail router logging,

  1. Login to CRM E-mail Router server
  2. In Windows Explorer, locate the Microsoft.Crm.Tools.EmailAgent.xml file. By default, this file is located in the following folder: SystemDrive:\Program Files\Microsoft CRM Email\Service
  3. This is the configuration file for the Email router , Open the file by using Notepad or another text-editing program.
  4. In the file, examine the <SystemConfiguration> node, and then scroll down the text toward the end of the file to find the following statement: <LogLevel>1</LogLevel>By default, this value is set to 1. Modify this statement so that it reads as follows: <LogLevel>3</LogLevel>, If you want to save logs into text file, you can specify the log file location as <LogFile> c:\emailrouterlog.txt </LogFile>  where you want it to put the log file. If you don’t mention log file location, all logs will be saved into windows event logs under MSCRMEmailLog. It is in this Event Viewer log view that the events appear.
  5. Save the file.
  6. Restart the E-mail Router Service.

When the LogLevel is set to 3 and a logfile location is specified, all router actions will be written to a log file in the specified location. If we don’t specify the log file location, all router actions will be logged in windows event logs. You will find a new Event Viewer log view that is named MSCRMEmailLog.

The router log will give you a lot of details, including granular detail on each incoming and outgoing email that it processes. Open the log file from the location specified,  or open the windows event logs and review the captured error messages. You can find the problem with a specific email by searching the log file for the subject of the email.

Here is the sample Microsoft.Crm.Tools.EmailAgent.xml with logging options.

<?xml version="1.0" encoding="utf-8"?>
<Configuration>
  <SystemConfiguration>
    <MaxThreads>50</MaxThreads>
    <MaxThreadExecution>600000</MaxThreadExecution>
    <SchedulingPeriod>1000</SchedulingPeriod>
    <ConfigRefreshPeriod>5000</ConfigRefreshPeriod>
    <ConfigUpdatePeriod>3600000</ConfigUpdatePeriod>
    <LogLevel>3</LogLevel>
   <LogFile> c:\emailrouterlog.txt </LogFile>
    <ProviderOverrides>
      <CacheCapacity>1024</CacheCapacity>
      <PendingStatusDelay>300000</PendingStatusDelay>
      <SendingStatusDelay>1800000</SendingStatusDelay>
      <MaximumDeliveryAttempts>10</MaximumDeliveryAttempts>
      <EWSRetrieveMessageCount>10</EWSRetrieveMessageCount>
      <BatchSize>5</BatchSize>
      <RequestBatchSize>5</RequestBatchSize>
    </ProviderOverrides>
  </SystemConfiguration>
</Configuration>

Turn off tracing: While email router logs are helpful while troubleshooting an error with the router, they capture large volumes of detail while enabled, so I would suggest they should be turned off when you are done otherwise it causes disk space issues in the server if it is enabled for long time, seriously it caused us in QA when we forgot to turn off in QA.

Advertisements

3 thoughts on “Set tracing/logging in Dynamics CRM 2011 E-mail Router

  1. What happens when you can’t open the Microsoft.Crm.Tools.EmailAgent.xml ? I get a access denied? Does something have to be disabled before you can access this file?

    • Dear Carolyn, Open a Notepad as Administrator. then Navigate to location where it is the XML file and open it. if you have the correct permission, you should be able to open it.

      Thanks

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s