Logging in custom database in Microsoft Dynamics CRM

The tool is available for download at the codeplex site: https://enterpriselogger.codeplex.com/.

The entire documentation of the tool and how to use it can be found in the documentation tab in the codeplex site. In case you want to keep reading this blog, I suggest you go back to the link:  https://debajmecrm.com/2014/06/26/enterprise-logger-for-microsoft-dynamics-crm/ and gather an idea about the tool and what it does.


Here we would see how we can log in custom database from CRM just by tweaking the configuration page without even changing a single line of code. Please note that for this to work, the users should have access to the custom database with write permissions to the table where logging would be done.

I come back to the configuration page of “Xrm Logger” solution and this time I select “Database” as the logging mechanism.


The following information needs to be entered

  • Connection String :  the connecting string to the custom database
  • Table name : the name of the table where logging would be done.
  • Message – The column name of the table where the Error Message/ Warning/ Message logged by the logger would be stored
  • Message Type – The column name in the custom database table that would store the value indicating where it is Error/ Warning/ Message
  • Stack Trace – The column to store the Stack Trace information in case of an error
  • Source Method – The column to store the name of the method from where the logger has been invoked. Basically whatever you pass in the parameter methodSource of the logging method, that value would be stored here
  • Log Time – The timestamp when the logging happened.


I have a custom database where the logging would be done. I enter all the fields and save the configuration. Please check for the screen shots below.

Screenshot for the database where logging would be done.



Values entered in the configuration entity


Please note that the connection string is stored in the CRM database Encoded and any user other than the system administrator would not be able to view the connecting string in plain text format.

Now I go again in CRM and create an account. And when I query the Log Table the following is the screenshot of what I get.


And you have logged in your custom database without changing a single line of code. Hope this would surely help.

In case this is not what you are looking for and you intend for and you want to keep the logging totally within the bounds of CRM, this tool won’t disappoint you. Please refer to the link – https://debajmecrm.com/2014/06/26/logging-in-crm-entity-with-enterprise-logger-tool/


One thought on “Logging in custom database in Microsoft Dynamics CRM”

Leave a Reply