Using the Support Debugging Tool to automatically start logging

David Meego - Click for blog homepageI was planning to write about a different topic, but that will have to wait until next week now.  The reason is that the all powerful Mark Polino has declared this week to be a Support Debugging Tool week.

This post will be divided into two sections, the first discussing DEXSQL.LOG logging only and second discussing Manual Logging Mode which creates the DEXSQL.LOG but also adds Dexterity Scripting Logging and Dexterity Script Profiling.


The DEXSQL.LOG logging basically logs all the communication between Dexterity and SQL Server via the ODBC connection.  It can often provide more information when Dexterity reports table based errors.  However, it does not usually help much when the problem is at the Dexterity level or does not involve SQL tables (such as local ctree temporary tables).

Most people know the settings to change in the DEX.INI to enable the SQL Logging as per KB 850996.  However, the Support Debugging Tool (SDT) provides a nice user interface to those settings plus a couple of additional features.

Once the Support Debugging Tool is installed, select Microsoft Dynamics GP >> Tools >> Support Debugging Tool or press Ctrl-D to open the main window.  Select Options >> Dex.ini Settings to open the Dex.ini Settings window. Check the Enable SQL Logging on next login option to have the SDT change the DEX.INI settings for you. 

The first additional features are that you can specify a different folder to store the DEXSQL.LOG file in, this uses th SQLLogPath setting. This is not a specific Support Debugging Tool feature, just one that most people don't know and the SDT provides a user interface to.  If you are on a network and have the user's home folder mapped to a drive letter say "H:", you can specify the target folder into the home folder.  If you are running on a Terminal Server where multiple user sessions use a single application folder, changing the folder in this fashion can stop the DEXSQL.LOG file containing information from multiple user sessions.

The second additional feature is added by the Support Debugging Tool.  It allows the DEXSQL.LOG file to be renamed automatically at the start of each day to prevent the file reaching its 2GB size limit.  It will be renamed to include the date in the file name.

Manual Logging Mode after login

The Support Debugging Tool has a Manual Logging Mode which enables the DEXSQL.LOG logging as well as Dexterity Script Logging (Script.log) and Dexterity Script Profiling (Profile.txt).  It also names the saved files with the user & company and the date & time.   This can be enabled manually using the "Turn On" button on the Support Debugging Tool main window or by using the Tools menu on any window or the Ctrl+Shift+F9 shortcut key (use Ctrl+Shift+F10 to stop logging).


But what if I want all three logs captured automatically without needing the user to turn logging on?  Well, this can be achieved by using Automatic Debugger Mode and creating a Trigger ID which does not have the trigger details completed.  From the main window select Options >> Setup Automatic Debugger Mode.  Note: If this option is not on the menu, check Enable Debugger Advanced Mode Featuresin the Dex.ini Settings window.

Create a Trigger ID (using the DEFAULT ID works fine) and make sure that it is set to Start Trigger Automatically on Login and that the Trigger Type is not set (leave as "Select Trigger Type"). Save the Trigger and close the window.

On next login, the trigger will start Automatic Debugging Mode, realise there are no triggers actually registered and so drop back to Manual Logging Mode until the logging is stopped by using one of the manual methods (button, menu or keyboard shortcut) or when the user exits the application or switches company.

Manual Logging Mode before login

So what if I want the Support Debugging Tool to activate Manual Logging Mode earlier to capture what happens from the application launching up to when the login is completed. Well there is an option to activate this type of logging on the Dex.ini Settings window.  Check the Start Logging on next startup only (Stops after login completed) option, this will add the MBS_Debug_LogOnStartup=TRUE setting to the DEX.INI.

The MBS_Debug_LogOnStartup setting is reset after it has been used once and so will not allow continuous logging of activity prior to login.  To get around this, we can use the Advanced Mode Dex.ini Configuration window.  On this window we can add the MBS_Debug_LogOnStartup=TRUE setting back to the Dex.ini after login, so that it will be enabled for next time automatically.

Now you know everything about how to start DEXSQL.LOG logging or Manual Logging Mode using the Support Debugging Tool.

Hope you find this useful.