1

I am writing a payment connector for Dynamics AX 2012 R3 using the payment SDK. In the payment sdk trace events are being raised using the Microsoft.Dynamics.Retail.Diagnostics.NetTracer class.

NetTracer.Error(string.Format("Calling PaymentProcessorManager.Create failed for the path: {0} due to {1}", (object) PaymentProcessorManager.connectorPath, (object) ex.Message));

How do I capture/view these trace events when they happen in client Ax32.exe? I have already tried modifying the .config file and adding a trace listener but I am getting nothing. I know that the trace line is being hit.

Danielg
  • 2,669
  • 1
  • 22
  • 17

1 Answers1

0

Add the following to ax32.exe.config in the client\bin folder:

  <system.diagnostics>
    <sources>
      <!-- this registers the listener with traces from a specific source -->
      <source name="RetailNetTracerEventLog" switchValue="Information">
        <listeners>
          <add name="EventLogTraceListener" />
        </listeners>
      </source>
    </sources>
    <!-- this defines a listener -->
    <sharedListeners>
      <add name="EventLogTraceListener" type="System.Diagnostics.EventLogTraceListener" initializeData="Microsoft Dynamics AX Client" />
    </sharedListeners>
    <!-- this configures tracing -->
    <trace autoflush="true">
      <listeners>
        <remove name="Default" />
        <add name="EventLogTraceListener" />
      </listeners>
    </trace>
  </system.diagnostics>

You may also need to add this block to Ax32Serv.exe.config, in the server\bin folder.

I had previously stumbled through several guesses at the right way to add a listener, but this is what worked for me. The NetTracer messages should appear in the regular Windows Application event log.

Andrew Huey
  • 832
  • 9
  • 20