-
Notifications
You must be signed in to change notification settings - Fork 334
Debugging
There are several tools available to help you debug your application.
The Microsoft.Owin.Diagnostics nuget package contains a welcome page and an error page. The UseWelcomePage extensions can be used to add a simple html page to your application to verify the site is up and running. The UseErrorPage extensions can be used to add an Exception filter to the request pipeline that will display exception and request details.
Starting with v4.0.1 Katana's debug symbols are now being published to the Microsoft Symbol Server. This will get you improved stack traces and type inspection, but not source stepping. See this issue for future followup.
The Katana servers and middleware log errors to the .NET trace infrastructure by default. Components log under their full name, including namespace, so logs can be enabled per component, per namespace, or globally for everything in the Microsoft.Owin namespaces. By default logs are sent to the Visual Studio output console during debugging. Here's how to also direct them to a file:
<system.diagnostics>
<trace autoflush="true" />
<sources>
<source name="Microsoft.Owin">
<listeners>
<add name="KatanaListener"/>
</listeners>
</source>
</sources>
<sharedListeners>
<add
name="KatanaListener"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="Katana.trace.log"
traceOutputOptions = "ProcessId, DateTime"
/>
</sharedListeners>
<switches>
<add name="Microsoft.Owin" value="Verbose" />
</switches>
</system.diagnostics>