serilog-contrib / serilog-sinks-applicationinsights

A Serilog sink that writes events to Microsoft Azure Application Insights
Apache License 2.0
220 stars 72 forks source link

SQL query logs can't be enabled #211

Open mahdiprog opened 1 year ago

mahdiprog commented 1 year ago

According to Microsoft documentation, after SDK version 2.14.0, in order to send SQL query logs to App Insights, we need to add the following code snippet:

services.ConfigureTelemetryModule<DependencyTrackingTelemetryModule>((module, o) => { module. EnableSqlCommandTextInstrumentation = true; });

Description I couldn't find any place for enabling it in Serilog sink

Reproduction

  1. Use AppInsights sink
  2. Execute any SQL query
  3. It won't be shown in Azure

Expected behavior There should be a way to enable it. within code and via appsettings

Relevant package, tooling and runtime versions Serilog.Sinks.ApplicationInsights V4.0.0

Additional context Add any other context about the problem here.