How much I love various corporate platforms: Exchange, Active Directory, SharePoint, Dynamics CRM. It's so interesting to tune them! Quite usual diagnostics of errors becomes an amazing quest, and to understand the cause of the error, you got to collect information bit by bit, only then revealing the whole picture. Recently I had to deploy Microsoft CRM in our company, so this article is about from where the developer should start if there are errors in Dynamics CRM.
Windows Log. Perhaps, the easiest and the most trivial way to check why one or another part of CRM doesn't work is to check Windows Event Log. Useful information can be found in these three sections: Application, Security and System.
CRM Trace Log & Dev Errors. This one is the most information rich sources about what's going on inside CRM processes. There are multiple ways to enable tracing, which can vary depending on the CRM version. As I was working mostly with CRM 4.0, written below refers to this version mostly.
The easiest way to enable CRM Trace Log is to use CRM Diagnostics Tool. Also, this utility allows to enable Dev Errors. After this CRM will start showing verbose output about errors to end-users.
To review the logs you can use a little program CRM Trace Log Viewer. And don't even try to view the logs in the Notepad. CRM updates the log very frequently, it becomes huge, and finding anything there manually is quite uneasy thing to do. By the way, by default, trace logs files are stored in C:\Program Files\Microsoft Dynamics CRM\Trace.
Attention! This log is very actively updated, which negatively impacts performance. I'm not kidding! Once I've forgot to disable trace log, and began data import. Log size has grown up to 10 Gb in 20 minutes, and soon ended up taking the whole free space on disk.
IIS Log. Also very useful place. You can view all HTTP requests to CRM here. Typical record looks something like this one:
2011-12-31 00:23:55 ::1 POST /MSCrmServices/2007/CrmService.asmx - 80 - ::1 Mozilla/4.0+(compatible;+MSIE+6.0;+MS+Web+Services+Client+Protocol+2.0.50727.5448) 401 2 5 0
Point your attention to the last figures. Here is what they can tell you:
- Field sc-status. This is nothing else than HTTP response code. In this particular case the error code is HTTP 401 Unauthorized. Practically, error 401 is almost one of the widely spread errors, which you can get in IIS.
- Field sc-substatus. For example, substatus 2 means “Denied by server configuration”. I also remember getting substatus 5 "Authorization failed by an ISAPI/CGI ", which means that IIS authorization is not set correctly, and you need to check CRM itself. As you can see, substatus allows to narrow down the error scope.
- Field sc-win32-status. In this case 5 "ERROR_ACCESS_DENIED". Nothing really new, but can be useful, as there are a lot of codes described in the documentation.
IIS server logs can be found in the folder C:\inetpub\logs. But you got to know it yourself already!
Performance Counters. I didn't use this functionality too much, but this one can definitely give you a bunch of useful information. There is no need to list all available counters here, they're described in all details in the documentation. Here is the list of counters categories:
- CRM Async Service
- CRM Authentication
- CRM Discovery
- CRM Locator Service
- CRM Outlook Sync
- CRM Platform
- CRM Server
- CRM Sql Governor
So, as you can see, almost all aspects of Dynamics CRM can be monitored with performance counters
Windows Log. Perhaps, the easiest and the most trivial way to check why one or another part of CRM doesn't work is to check Windows Event Log. Useful information can be found in these three sections: Application, Security and System.
CRM Trace Log & Dev Errors. This one is the most information rich sources about what's going on inside CRM processes. There are multiple ways to enable tracing, which can vary depending on the CRM version. As I was working mostly with CRM 4.0, written below refers to this version mostly.
The easiest way to enable CRM Trace Log is to use CRM Diagnostics Tool. Also, this utility allows to enable Dev Errors. After this CRM will start showing verbose output about errors to end-users.
To review the logs you can use a little program CRM Trace Log Viewer. And don't even try to view the logs in the Notepad. CRM updates the log very frequently, it becomes huge, and finding anything there manually is quite uneasy thing to do. By the way, by default, trace logs files are stored in C:\Program Files\Microsoft Dynamics CRM\Trace.
Attention! This log is very actively updated, which negatively impacts performance. I'm not kidding! Once I've forgot to disable trace log, and began data import. Log size has grown up to 10 Gb in 20 minutes, and soon ended up taking the whole free space on disk.
IIS Log. Also very useful place. You can view all HTTP requests to CRM here. Typical record looks something like this one:
2011-12-31 00:23:55 ::1 POST /MSCrmServices/2007/CrmService.asmx - 80 - ::1 Mozilla/4.0+(compatible;+MSIE+6.0;+MS+Web+Services+Client+Protocol+2.0.50727.5448) 401 2 5 0
Point your attention to the last figures. Here is what they can tell you:
- Field sc-status. This is nothing else than HTTP response code. In this particular case the error code is HTTP 401 Unauthorized. Practically, error 401 is almost one of the widely spread errors, which you can get in IIS.
- Field sc-substatus. For example, substatus 2 means “Denied by server configuration”. I also remember getting substatus 5 "Authorization failed by an ISAPI/CGI ", which means that IIS authorization is not set correctly, and you need to check CRM itself. As you can see, substatus allows to narrow down the error scope.
- Field sc-win32-status. In this case 5 "ERROR_ACCESS_DENIED". Nothing really new, but can be useful, as there are a lot of codes described in the documentation.
IIS server logs can be found in the folder C:\inetpub\logs. But you got to know it yourself already!
Performance Counters. I didn't use this functionality too much, but this one can definitely give you a bunch of useful information. There is no need to list all available counters here, they're described in all details in the documentation. Here is the list of counters categories:
- CRM Async Service
- CRM Authentication
- CRM Discovery
- CRM Locator Service
- CRM Outlook Sync
- CRM Platform
- CRM Server
- CRM Sql Governor
So, as you can see, almost all aspects of Dynamics CRM can be monitored with performance counters
No comments:
Post a Comment