Skip to content

AI Method 1

Ahmad Sattar edited this page Oct 24, 2019 · 10 revisions

1. Traces only

Example configuration can be found here.

This first method of logging sends the same trace Dynamics 365 logs to AI, but correlates traces across invocation.
The logs would look like this: Trace logs of method 1

Setting it up

  1. Copy the DGTracingService and IDGTracingService into your plugins project
  2. Insert your instrumentation key at the top of DGTracingService
    • It is also possible to fetch the instrumentation key with the OrganizationService that resides in the LocalPluginContext constructor step 3 uses
  3. Inside Plugin.cs add the following inside the LocalPluginContext constructor, below line containing this.TracingService = (ITracingService)serviceProvider.GetService(typeof(ITracingService));
this.TracingService = new DGTracingService(this.TracingService, this.PluginExecutionContext.CorrelationId);
Clone this wiki locally