跟踪和诊断System.Data.SQLConnectionSystem、Data、SQLConnection

2023-09-03 16:35:51 作者:不喊我全名的人那么少i

我想知道是否有去允许跟踪/诊断上通过app.config文件的SQLConnection很像你可以用,当你需要跟踪的支持(如下图)WCF?

Hi i was wondering if there is away to allow tracing / diagnostics on a SQLConnection via the app.config file much like you can with WCF when you need tracing support (as below)?

<system.diagnostics>
   <switches>
      <add name="DataMessagesSwitch" value="0" />
      <add name="TraceLevelSwitch" value="0" />
   </switches>
</system.diagnostics>

我试图拦截和记录从我的应用程序SQL请求(无需创建的IDbConnection垫片过的SQLConnection捕捉到的请求,因为他们执行)

I'm trying to intercept and log SQL requests from within my application (without needing to create an IDBConnection shim over a SQLConnection to capture the requests as they are executed)

有什么想法?

推荐答案

ADO .NET技术文章:跟踪数据访问帮助吗?