# Entity Framework: Intercepting SQL Queries for Contextual Logging

DevFeed: [Entity Framework: Intercepting SQL Queries for Contextual Logging](<https://devfeed.tech/articles/entity-framework-intercepting-sql-queries-for-contextual-logging-21187.md>)

Original publisher: [Read original article](<https://juri.dev/blog/2013/03/intercepting-sql-queries-for-contextual-logging/>)

Published: 2013-03-21T00:00:00Z

Content type: tutorial

Language: en

Sources: [Juri Strumpflohner](<https://devfeed.tech/sources/juri-strumpflohner.md>)

Topics: [Framework](<https://devfeed.tech/topics/framework.md>), [SQL](<https://devfeed.tech/topics/sql.md>), [Logging](<https://devfeed.tech/topics/logging.md>), [Oracle Database](<https://devfeed.tech/topics/oracle-database.md>), [NuGet](<https://devfeed.tech/topics/nuget.md>)

Tags: [framework](<https://devfeed.tech/tags/framework.md>), [logging](<https://devfeed.tech/tags/logging.md>), [nuget](<https://devfeed.tech/tags/nuget.md>), [oracle](<https://devfeed.tech/tags/oracle.md>), [sql](<https://devfeed.tech/tags/sql.md>)

## AI overview

This tutorial describes using MiniProfiler to intercept Entity Framework SQL queries and include the executed SQL statement as contextual information in production error logs. The example involves diagnosing an intermittent insufficient-privileges exception against an Oracle database.

## Source excerpt

Lorem ipsum dolor sit amet