Skip to content

Enable EF Core query logging for App Insights#582

Merged
paulvanbrenk merged 1 commit intomainfrom
config/ef-core-query-logging
Mar 26, 2026
Merged

Enable EF Core query logging for App Insights#582
paulvanbrenk merged 1 commit intomainfrom
config/ef-core-query-logging

Conversation

@paulvanbrenk
Copy link
Collaborator

Summary

  • Enables Microsoft.EntityFrameworkCore.Database.Command at Information level in both API and Functions
  • SQL queries with duration now flow into App Insights as dependency telemetry
  • Enables end-to-end tracing from API request through database queries
  • No cost concern — estimated ~70-350 MB/month, well within the 5 GB/month free tier

Changes

  • PatchNotes.Api/appsettings.json — added EF Core log level
  • PatchNotes.Functions/host.json — added EF Core log level

Test plan

  • Deploy and verify SQL queries appear in App Insights > Dependencies
  • Check slow queries via: dependencies | where type == "SQL" | where duration > 1000

🤖 Generated with Claude Code

Set Microsoft.EntityFrameworkCore.Database.Command to Information in
both the API and Functions projects so individual SQL queries (with
duration) flow into Application Insights as dependency telemetry.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@paulvanbrenk paulvanbrenk enabled auto-merge March 26, 2026 21:25
@paulvanbrenk paulvanbrenk merged commit e0a760f into main Mar 26, 2026
4 checks passed
@paulvanbrenk paulvanbrenk deleted the config/ef-core-query-logging branch March 26, 2026 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant