如何阻止 IISExpress 将每个请求的每个细节转储到 Visual Studio 输出 window?
How can I stop IISExpress from dumping every detail of every request into the Visual Studio Output window?
我的 VS 2013 输出 window 充满了这个:
iisexpress.exe Information: 0 : Request, Method=GET, Url=http://localhost:51741/api/Clients/?$filter=UniqueName eq '6269', Message='http://localhost:51741/api/Clients/?$filter=UniqueName eq '6269''
iisexpress.exe Information: 0 : Message='Clients', Operation=DefaultHttpControllerSelector.SelectController
iisexpress.exe Information: 0 : Message='MyProj.Controllers.ClientsController', Operation=DefaultHttpControllerActivator.Create
iisexpress.exe Information: 0 : Message='MyProj.Controllers.ClientsController', Operation=HttpControllerDescriptor.CreateController
iisexpress.exe Information: 0 : Message='Selected action 'GetClients()'', Operation=ApiControllerActionSelector.SelectAction
iisexpress.exe Information: 0 : Operation=HttpActionBinding.ExecuteBindingAsync
iisexpress.exe Information: 0 : Operation=QueryableAttribute.ActionExecuting
iisexpress.exe Information: 0 : Message='Action returned 'System.Collections.Generic.List`1[MyProj.Models.ClientDto]'', Operation=ReflectedHttpActionDescriptor.ExecuteAsync
iisexpress.exe Information: 0 : Message='Will use same 'JsonMediaTypeFormatter' formatter', Operation=JsonMediaTypeFormatter.GetPerRequestFormatterInstance
iisexpress.exe Information: 0 : Message='Selected formatter='JsonMediaTypeFormatter', content-type='application/json; charset=utf-8'', Operation=DefaultContentNegotiator.Negotiate
iisexpress.exe Information: 0 : Operation=ApiControllerActionInvoker.InvokeActionAsync, Status=200 (OK)
iisexpress.exe Information: 0 : Operation=QueryableAttribute.ActionExecuted, Status=200 (OK)
iisexpress.exe Information: 0 : Operation=ClientsController.ExecuteAsync, Status=200 (OK)
iisexpress.exe Information: 0 : Response, Status=200 (OK), Method=GET, Url=http://localhost:51741/api/Clients/?$filter=UniqueName eq '6269', Message='Content-type='application/json; charset=utf-8', content-length=unknown'
iisexpress.exe Information: 0 : Operation=JsonMediaTypeFormatter.WriteToStreamAsync
iisexpress.exe Information: 0 : Operation=ClientsController.Dispose
如何关闭所有这些?我只想看到 my 对 Trace.TraceInformation
、Trace.TraceError
、Trace.TraceWarning
等的调用
添加这个有用吗?
<location path="YouSiteName">
<system.webServer>
<httpLogging dontLog="true" />
</system.webServer>
</location>
首先,当您使用像
这样的代码时
Trace.TraceInformation("My Custom Info Message.");
用于跟踪(无论来自什么地方 - 页面、控制器或来自单独的 .dll 的其他 class)然后 运行 您在 IIS 下的应用程序 Express MS VS 输出 window 会显示类似
iisexpress.exe Information: 0 : My Custom Info Message.
你怎么知道什么是"yours",什么是"not yours"?
也许您应该为每条消息添加额外的标记?但是as I could see输出windows仍然不支持自定义标签或文本的消息过滤,但它支持文本搜索(Ctrl+F),所以...
我在 IIS Express 向输出发送垃圾邮件时遇到了同样的问题 windows,消息是这样的
'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-1-130838650006648508): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
我通过转到 MS VS (2013) 主菜单解决了这个问题
-> 调试 -> 选项和设置... -> 调试 -> 输出 Window
并关闭不需要的输出消息类型
在 App_Start\WebApiConfig.cs
中,移除 config.EnableSystemDiagnosticsTracing();
就这么简单:facepalm:
我的 VS 2013 输出 window 充满了这个:
iisexpress.exe Information: 0 : Request, Method=GET, Url=http://localhost:51741/api/Clients/?$filter=UniqueName eq '6269', Message='http://localhost:51741/api/Clients/?$filter=UniqueName eq '6269''
iisexpress.exe Information: 0 : Message='Clients', Operation=DefaultHttpControllerSelector.SelectController
iisexpress.exe Information: 0 : Message='MyProj.Controllers.ClientsController', Operation=DefaultHttpControllerActivator.Create
iisexpress.exe Information: 0 : Message='MyProj.Controllers.ClientsController', Operation=HttpControllerDescriptor.CreateController
iisexpress.exe Information: 0 : Message='Selected action 'GetClients()'', Operation=ApiControllerActionSelector.SelectAction
iisexpress.exe Information: 0 : Operation=HttpActionBinding.ExecuteBindingAsync
iisexpress.exe Information: 0 : Operation=QueryableAttribute.ActionExecuting
iisexpress.exe Information: 0 : Message='Action returned 'System.Collections.Generic.List`1[MyProj.Models.ClientDto]'', Operation=ReflectedHttpActionDescriptor.ExecuteAsync
iisexpress.exe Information: 0 : Message='Will use same 'JsonMediaTypeFormatter' formatter', Operation=JsonMediaTypeFormatter.GetPerRequestFormatterInstance
iisexpress.exe Information: 0 : Message='Selected formatter='JsonMediaTypeFormatter', content-type='application/json; charset=utf-8'', Operation=DefaultContentNegotiator.Negotiate
iisexpress.exe Information: 0 : Operation=ApiControllerActionInvoker.InvokeActionAsync, Status=200 (OK)
iisexpress.exe Information: 0 : Operation=QueryableAttribute.ActionExecuted, Status=200 (OK)
iisexpress.exe Information: 0 : Operation=ClientsController.ExecuteAsync, Status=200 (OK)
iisexpress.exe Information: 0 : Response, Status=200 (OK), Method=GET, Url=http://localhost:51741/api/Clients/?$filter=UniqueName eq '6269', Message='Content-type='application/json; charset=utf-8', content-length=unknown'
iisexpress.exe Information: 0 : Operation=JsonMediaTypeFormatter.WriteToStreamAsync
iisexpress.exe Information: 0 : Operation=ClientsController.Dispose
如何关闭所有这些?我只想看到 my 对 Trace.TraceInformation
、Trace.TraceError
、Trace.TraceWarning
等的调用
添加这个有用吗?
<location path="YouSiteName">
<system.webServer>
<httpLogging dontLog="true" />
</system.webServer>
</location>
首先,当您使用像
这样的代码时Trace.TraceInformation("My Custom Info Message.");
用于跟踪(无论来自什么地方 - 页面、控制器或来自单独的 .dll 的其他 class)然后 运行 您在 IIS 下的应用程序 Express MS VS 输出 window 会显示类似
iisexpress.exe Information: 0 : My Custom Info Message.
你怎么知道什么是"yours",什么是"not yours"? 也许您应该为每条消息添加额外的标记?但是as I could see输出windows仍然不支持自定义标签或文本的消息过滤,但它支持文本搜索(Ctrl+F),所以...
我在 IIS Express 向输出发送垃圾邮件时遇到了同样的问题 windows,消息是这样的
'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-1-130838650006648508): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
我通过转到 MS VS (2013) 主菜单解决了这个问题
-> 调试 -> 选项和设置... -> 调试 -> 输出 Window
并关闭不需要的输出消息类型
在 App_Start\WebApiConfig.cs
中,移除 config.EnableSystemDiagnosticsTracing();
就这么简单:facepalm: