How to capture OWIN logs in Azure App Service
How to capture OWIN logs in Azure App Service
Here are the steps to capture Owin Logs from your Azure Website:
-
Go the Azure Portal and go to your App Service and then open the KUDU console as shown below:
-
You can also open the KUDU console of your website by navigating to the SCM site directly, for example *http://.scm.Azurewebsites.net** (replace* with your website name)
-
Once you are inside the KUDU console, go to Debug Console and then CMD as shown below:
-
Once you are inside the CMD go to the site folder and then wwwroot folder, as shown below:
-
Once you are within the wwwroot folder, locate the web.config file and click the pencil icon to edit the file:
Please place the below code as a separate section in the web.config
<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="d:\home\logfiles\Katana.trace.log" traceOutputOptions="ProcessId, DateTime"/> </sharedListeners> <switches> <add name="Microsoft.Owin" value="Verbose"/> </switches> </system.diagnostics>
-
Once you have saved the web.config file, restart the website from the Azure Portal: