epalm
epalm

Reputation: 4423

How can I stop IISExpress from dumping every detail of every request into the Visual Studio Output window?

My VS 2013 output window is full of this:

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

How do I turn all that off? All I want to see are my calls to Trace.TraceInformation, Trace.TraceError, Trace.TraceWarning, etc.

Upvotes: 28

Views: 6028

Answers (3)

epalm
epalm

Reputation: 4423

In App_Start\WebApiConfig.cs, remove config.EnableSystemDiagnosticsTracing();

Upvotes: 7

VAV
VAV

Reputation: 1896

First off all, when you use code like

Trace.TraceInformation("My Custom Info Message.");

for tracing (not matter from what place - page, controller or some other class from separate .dll) and then run your application under IIS Express the MS VS Output window would show something like

iisexpress.exe Information: 0 : My Custom Info Message.

How could you recognize what messages is "yours" and what is "not yours"? Maybe you should add additional marker for each your messages? But as I could see the Output windows still does not support the message filtering by the custom tags or text, but it's support the text Search (Ctrl+F), so...

I had the same issue with IIS Express spamming to the output windows with messages like this

'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.

I had solved that by going to the MS VS (2013) main menu

-> DEBUG -> Options & Settings... -> Debugging -> Output Window

and turning Off unneeded output messages types

General Output Settings

Upvotes: 29

Gariig
Gariig

Reputation: 131

Does adding this work?

<location path="YouSiteName">
    <system.webServer>
        <httpLogging dontLog="true" />
    </system.webServer>
</location>

Found at: http://forums.iis.net/post/1992357.aspx

Upvotes: 0

Related Questions