Skip to content

Commit e2ca62d

Browse files
committed
Merging changes synced from https://github.com/MicrosoftDocs/powerapps-docs-pr (branch live)
2 parents 4d25e9e + 71833e4 commit e2ca62d

File tree

4 files changed

+107
-120
lines changed

4 files changed

+107
-120
lines changed

powerapps-docs/developer/data-platform/application-insights-ilogger.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
---
22
title: "Write Telemetry to your Application Insights resource using ILogger (Microsoft Dataverse) | Microsoft Docs"
33
description: "When you enable Application Insights for your organization, any plug-ins written using the ILogger Interface provided in the SDK will write telemetry to your Application Insights resource."
4-
ms.date: 07/14/2022
4+
ms.date: 10/06/2022
55
author: divka78
66
ms.author: dikamath
7-
manager: sunilg
87
ms.reviewer: pehecke
9-
ms.topic: "article"
8+
ms.topic: article
109
ms.subservice: dataverse-developer
1110
search.audienceType:
1211
- developer
@@ -49,14 +48,17 @@ You should continue to use the [ITracingService.Trace](/dotnet/api/microsoft.xrm
4948

5049
You should use [ILogger](/dotnet/api/microsoft.xrm.sdk.plugintelemetry.ilogger) because it will allow for telemetry about what happens within a plug-in to be integrated with the larger scope of data captured with the Application Insights integration. The Application Insights integration will tell you when a plug-in executes, how long it takes to run and whether it makes any external http requests, but Microsoft cannot add any telemetry code within the plug-ins that people write to extend the behavior of the platform.
5150

52-
If you are an ISV with a product that includes plug-ins, your customers who enable Application Insights will appreciate being able to see what is going on within your plug-ins and this data may help you support them if there are issues. But data captured using ILogger will only be sent to the subscribing customers resource. You will only be able to see data captured for your own environments when you have Application Insights enabled.
51+
If you are an ISV with a product that includes plug-ins, your customers who enable Application Insights will appreciate being able to see what is going on within your plug-ins and this data may help you support them if there are issues. But data captured using ILogger will only be sent to the subscribing customer's resource. You will only be able to see data captured for your own environments when you have Application Insights enabled.
5352

5453
## Use ILogger
5554

5655
ILogger is a common interface for capturing log information. The implementation provided with the Organization Service SDK assemblies provides common methods to support establishing a scope and different levels of logging. There is currently no setting to control what level of logs are written. The levels can be used within Application Insights to filter which logs to view.
5756

5857
The following is an example of a plug-in using both ILogger and ITracingService.Trace.
5958

59+
> [!NOTE]
60+
> Make sure you include `using Microsoft.Xrm.Sdk.PluginTelemetry;`. Don't use `using Microsoft.Extensions.Logging;`, otherwise the `ILogger` instance will be null.
61+
6062
```csharp
6163
using Microsoft.Xrm.Sdk;
6264
using Microsoft.Xrm.Sdk.PluginTelemetry;

0 commit comments

Comments
 (0)