[英]Prevent Firebird from printing queries in Visual Studio debug output window
We have newly adopted Firebird in our project, using it via Entity Framework.我们在我们的项目中新采用了 Firebird,通过实体框架使用它。 I now noticed that Firebird prints every query to Visual Studio's debug output window.我现在注意到 Firebird 将每个查询打印到 Visual Studio 的调试输出窗口。 Here's a simplified example:这是一个简化的示例:
FirebirdSql.Data.FirebirdClient Information: 0 : Command:
SELECT
"B"."FOO" AS "FOO"
FROM "BAR" AS "B"
WHERE [...]
Parameters:
Name:p__linq__0 Type:TimeStamp Used Value:19.03.2020 07:57:59
Name:p__linq__1 Type:Guid Used Value:00000000-0000-0000-0000-000000000000
With the old DBMS we didn't have such output, so I don't think that some generic Entity Framework feature is at work here.使用旧的 DBMS 我们没有这样的输出,所以我不认为一些通用的实体框架功能在这里工作。 I am aware of DbContext.Database.Log
, but I doublechecked that we don't use this in our code base.我知道DbContext.Database.Log
,但我DbContext.Database.Log
过我们没有在我们的代码库中使用它。
I verified that it's not our logging framework (log4net) that redirects something to the VS debug output.我确认不是我们的日志框架 (log4net) 将某些内容重定向到 VS 调试输出。 Our app.config also does not contain anything that looks suspicious.我们的 app.config 也不包含任何看起来可疑的东西。 Last but not least, an internet search didn't yield anything useful.最后但并非最不重要的一点是,互联网搜索没有产生任何有用的信息。
So I am really at a loss here.所以我真的很茫然。 Do you know where this output comes from, and how I can disable it?你知道这个输出来自哪里,我如何禁用它?
We use Visual Studio 2019 and Firebird 3.我们使用 Visual Studio 2019 和 Firebird 3。
Open your app.config
and add this code:打开您的app.config
并添加以下代码:
<system.diagnostics>
<sources>
<source name="FirebirdSql.Data.FirebirdClient">
<listeners>
<clear />
</listeners>
</source>
</sources>
</system.diagnostics>
Now no diagnostics listener is configured and you get no output.现在没有配置诊断侦听器,也没有输出。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.