How to Enable Debug Tracing/Logging for Derived MSPs
First, make sure that the implementation of the derived MSP has followed the guidelines in the previous section with regard to debug tracing (defining the preprocessor symbol MSPLOG, registering for tracing during DllMain, and using the LOG macro for tracing). Find out what name the MSP uses when registering for tracing (this should usually be the DLL's name; it is referred to below as
"<dll name>"). To enable tracing, use a registry editor ("Regedit.exe" or "Regedt32.exe") to locate the key "HKEY_LOCAL_MACHINE\Software\Microsoft\Tracing" and do the following. Note that all of the values mentioned below, except the EnableDebuggerTracing value, should be created automatically after running your MSP for the first time.
- To enable tracing to user and kernel mode debuggers, set the DWORD value <dll name>\EnableDebuggerTracing to 1. Optionally, use the DWORD value <dll name>\ConsoleTracing Mask to enable or disable various levels of trace output (the default is 0xFFFF0000, which enables all trace levels).
- To enable tracing to a file, set the DWORD value <dll name>\EnableFileTracing to 1. Optionally, use the string value <dll name>\FileDirectory to adjust the location of the log file. Optionally, use the DWORD value <dll name>\FileTracingMask to enable or disable various levels of trace output (the default is 0xFFFF0000, which enables all trace levels).
- To enable tracing to a separate console window, separated by DLL, set the DWORD value EnableConsoleTracing to 1, AND ALSO set the DWORD value <dll name>\EnableConsoleTracing to 1. Optionally, use the DWORD value <dll name>\ConsoleTracing Mask to enable or disable various levels of trace output (the default is 0xFFFF0000, which enables all trace levels).