25

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.

Erik Philips
  • 53,428
  • 11
  • 128
  • 150
epalm
  • 4,283
  • 4
  • 43
  • 65

3 Answers3

25

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

VAV
  • 1,756
  • 1
  • 16
  • 26
  • 11
    Alternatively, you can set these from the context menu by right clicking in the Output window and toggling them on or off. I toggled off `Module Load Messages` and `Module Unload Messages`. – crush May 12 '16 at 14:08
  • Very nice, thank you, sir. Now I just have to get rid of the bloody billions of lines of `Application Insights` output. – ProfK Nov 30 '16 at 06:36
  • 1
    I wish I could give you like 40 upvotes for this. – Gargoyle Oct 01 '21 at 22:25
7

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

Simple as that :facepalm:

epalm
  • 4,283
  • 4
  • 43
  • 65
  • 2
    Don't have that line in my WebApiConfig, but am still getting these messages. – crush May 12 '16 at 14:06
  • I also still get the messages without that line, but if were there I would not want to just throw all tracing away. I would rather use the `System.Web.Http.Tracing.SystemDiagnosticsTraceWriter` that `EnableSystemDiagnosticsTracing` returns to configure system tracing, like setting a higher `MinimumLevel` or something. – ProfK Nov 30 '16 at 05:42
0

Does adding this work?

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

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

Gariig
  • 131
  • 1
  • 8