Creating A DexSQL.log File To Troubleshoot Errors In Dynamics GP

Often times the error messages displayed in Dynamics GP can be difficult to interpret when trying to pinpoint the actual issue at hand. I’ve worked with Dynamics GP for over 7 years and occasionally I still come across errors that I have never seen. Fortunately, Microsoft has a feature within Dynamics GP that allows you to capture everything that is occurring behind the scenes within the application.

A DexSQL.log file can be used to allow you to better troubleshoot errors that are occurring within the application. However, since the logging has to be turned on before it begins capturing data, its a good idea to make sure you can reproduce the error prior to using this feature.

One important thing to note before I discuss how to turn this feature on is that once activated, the DexSQL.log file will capture everything that is occurring with Dynamics GP. If you have multiple users logged into the system it will capture everything. As a result, this file can grow significantly if not kept in check. Years ago I made the mistake of forgetting to deactivate DexSQL logging and within a few hours the log file had grown to several gigabytes.  Luckily I realized my mistake and was able to deactivate logging but if left unchecked, the log file could potentially grow to a point where your server would run out of space.  Obviously, this would be a bad thing.

With that said, the first thing you want to do in order to begin creating a DexSQL.log file is to log into the server hosting the Dynamics GP application and navigate to the Dynamics GP Data folder.  This is usually found by navigating to the following directory:

 C:\Program Files(x86)\Microsoft Dynamics\GPxxxx\Data

dex_ini_filepath

Once you have navigated to the Data folder locate the Dex.ini file and open it.

Depending on your installation of Dynamics GP as well as the number of modules and third party applications you have installed, this file may contain anywhere from a few dozen lines up to a couple hundred.  However, you are only looking for 3 individual lines, which should be grouped together.

SQLLogSQLStmt=FALSE
SQLLogODBCMessages=FALSE
SQLLogAllODBCMessages=FALSE

Notice that these are currently set to FALSE. In order to turn on DexSQL logging you need to modify each of these by setting the qualifier to TRUE so that it appears as follows:

SQLLogSQLStmt=TRUE
SQLLogODBCMessages=TRUE
SQLLogAllODBCMessages=TRUE

Once the file has been updated, save it and close the file.

Now log into Dynamics GP.  If you are already logged in, you will need to log out and log back in before the logging for your session will take effect.  As previously mentioned, anyone who logs in after the .ini file has been updated will have their activity within Dynamics GP logged in the file.  This is why it is important to log in and recreate the error as quickly as possible and then turn off logging.

Once you have recreated the error, navigate back to the Dynamics GP Data folder and you should see a file named Dexsql.log

At this point it is a good idea to go back into the Dex.ini file and change the values back to FALSE.

Since all activity within Dynamics GP is captured by the log you may have quite a bit of data to sift through before you are able to locate the error you are investigating.  I have found that the quickest way to get to the section of the log that is most likely to contain the error is to do a quick search on the file for the login name of the session you used.  This will display the point in which your account initially logged into Dynamics GP.  The error should be somewhere close to that point.