我有一个在 Dynamics 365 环境中注册的 Dataverse 插件。我想将日志从插件发送到 Azure Application Insights。我配置了将数据导出到 Application Insights。 Dataverse 日志确实出现在 Application Insights 中,但插件日志没有出现。
我创建了一个 Dynamics 插件并添加了 ILogger 以将信息记录到 Application Insights,如下所示:
ILogger logger = (ILogger)serviceProvider.GetService(typeof(ILogger));
logger.LogInformation("Some log information");
如以下所述:https://learn.microsoft.com/en-us/power-apps/developer/data-platform/application-insights-ilogger
我还根据以下说明配置了将 dataverse 数据导出到应用程序见解:https://learn.microsoft.com/en-us/power-platform/admin/set-up-export-application-insights
然而,Application Insights 中没有出现任何痕迹(我还检查了 Application Insights 中的其他表)
ILogger
上的其他方法都不会将跟踪写入 Application Insights。
方法
ILogger.IsEnabled(LogLevel)
为每个 LogLevel 返回 False
。