Logging in custom database in Microsoft Dynamics CRM

The tool is available for download at the codeplex site:

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: 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 –


About Debajit
I am a Dynamics CRM Most Valuable Professional (MVP) with 10 years of experience in Microsoft .NET Technologies and 7 years of dedicated experience in Microsoft Dynamics CRM. I have worked with companies like Microsoft, SanDisk, PwC, TMF Group and have extensive experience of implementing complex CRM solutions from both offshore and client side. Currently the face of with significant experience in delivering corporate training on Dynamics CRM and have already delivered multiple projects to client through Author of multiple tools on codeplex including the 'Role Based Views' and 'CRM-Sharepoint Metadata manager & Attachment Extractor' which are available for commercial use under For consulting/ training, drop me a note at or visit our website

One Response to Logging in custom database in Microsoft Dynamics CRM

  1. Pingback: Logging in EventViewer with Enterprise CRM Logger. | Debajit's Dynamic CRM Blog

Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )

Connecting to %s

%d bloggers like this: