How to Trace Commerce Server Events

Commerce Server Core Systems uses Event Tracing for Windows (ETW). You can enable tracing for individual Commerce Server Core Systems components and examine the trace log to help debug issues.

Tracing Commerce Server Core System API Events in Windows Server 2008 and Windows 7

You can use the following to help you trace events:

  1. Open a Command Prompt window and navigate to the %COMMERCE_SERVER_ROOT%\support directory.

  2. Start a text editor and edit the cstraceguids_logman.ctl file.

  3. Type a "#" character in the first position of the row for each component that you do not want to trace. The only components whose trace messages you can format are as follows:

    • CommerceServer_Marketing. Trace events in the Marketing System.

    • CommerceServer_Orders. Trace events in the Orders System.

    • CommerceServer_Staging. Trace staging events.

    • CommerceServer_Catalog. Trace events in the Catalog and Inventory System.

    • XMLTracer. Trace pipeline events. For more information about XMLTracer, see Starting, Stopping, and Formatting XMLTracer Output.

    • Microsoft.Commerce.Trace.Presentation. Traces messages originating from the presentation layer in the Commerce foundation.

    • Microsoft.Commerce.Trace.Server. Traces messages originating from the server layer in the Commerce foundation.

    • Microsoft.Commerce.Trace.SequenceComponents. Traces messages originating from sequence componets in the Commerce foundation.

    • Microsoft.Commerce.Trace.CoreSystems. Traces messages originating from core systems in the commerce foundation.

    • Microsoft.Commerce.Trace.Custom. Traces messages originating from custom code running inside the commerce foundation.

    • Microsoft.Commerce.Trace.Client. Traces messages originating from end clients of the commerce foundation.

    • Microsoft.Commerce.Trace.Messages. Traces general messages from the commerce foundation.

    • Microsoft.Commerce.Auditing. Traces messages related to auditing checks performed in the commerce foundation.

    • Microsoft.Commerce.SessionToken. Traces messages related to session token management in the commerce foundation

  4. Save the cstraceguids_logman.ctl file.

  5. Enable tracing by running the logman command.

    Note

    The logman command creates and manages Event Trace Session and Performance logs and supports many functions of Performance Monitor from the command line. For information about the command and syntax, see https://go.microsoft.com/fwlink/?LinkId=178210.

    For example, to trace all levels of messages, type the following command:

    logman.exe create trace cstrace -pf cstraceguids_logman.ctl -o cstrace.etl -ets
    
  6. Run your Commerce Server Core Systems application, and run the scenario that you want to trace.

  7. Use the logman command to turn off tracing. For example, to turn off the trace that you turned on in step 5, type the following command:

    logman.exe stop cstrace -ets
    
  8. Run the tracerpt command to decode the trace log. You will need access to the .tmf files to fully decode the file.

    Note

    You can use the tracerpt command to parse Event Trace Logs, log files generated by Performance Monitor, and real-time Event Trace providers. It generates dump files, report files, and report schemas. For information about the tracerpt command, see https://go.microsoft.com/fwlink/?LinkId=178208.

    For example, to decode the trace information that you collected at step 5, type the following command:

    • To decode the file with .tmf files in a particular directory:
    tracerpt.exe -l cstrace.etl -o cstrace.txt -of CSV -tp <path to TMF directory>
    
    • To decode the file without .tmf files:
    tracerpt.exe -l cstrace.etl -o cstrace.txt -of CSV 
    

    Note

    This may produce many lines with unknown data.

See Also

Other Resources

Starting, Stopping, and Formatting XMLTracer Output

Troubleshooting Commerce Server Development