Sin categoría

How to capture Owin logs in Azure Websites

Here are the steps to capture Owin Logs from your Azure Website:

1. Go the Azure Portal and go to your App Service and then open the KUDU console as shown below:

2. 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)

3. Once you are inside the KUDU console, go to Debug Console and then CMD as shown below:

4. Once you are inside the CMD go to the site folder and then wwwroot folder, as shown below:

5. Once you are within the wwwroot folder, locate the web.config file and click the pencil icon to edit the file:

6. Within the web.config file add the following section and save the web.config 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=”d:\home\logfiles\Katana.trace.log”

traceOutputOptions=”ProcessId, DateTime”/>

    </sharedListeners>

    <switches>

      <add name=”Microsoft.Owin” value=”Verbose”/>

    </switches>

  </system.diagnostics>

7. Once you have saved the web.config file, restart the website from the Azure Portal:

8. Once everything is done, you will be able to see the OWIN Logs in the KUDU console in the following folder d:\home\logfiles\katana.trace.log.

Leave a Reply

Your email address will not be published. Required fields are marked *