Can I enable tracing in OWIN?

后端 未结 1 1875
盖世英雄少女心
盖世英雄少女心 2021-01-07 23:55

I have an environmental problem somewhere in OWIN and I want to get some information about what is happening. I have read that I can enable tracing but can\'t find much info

相关标签:
1条回答
  • 2021-01-08 00:42

    Not 100% sure that this will solve your issue, but we got it working with following config. Slight difference in the following line:

    <source name="Microsoft.Owin" switchName="Microsoft.Owin" switchType="System.Diagnostics.SourceSwitch">
    

    Notice that the <source> tag includes a switchName (and switchType) attribute which is missing from your example. I think that this instruction links the TraceSource with the Switch and makes the entire work.

    In our case, we use trace listeners for Azure Web sites (and web jobs).

     <system.diagnostics>
        <sharedListeners>
          <add name="AzureTableTraceListener" type="Microsoft.WindowsAzure.WebSites.Diagnostics.AzureTableTraceListener, Microsoft.WindowsAzure.WebSites.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
          <add name="AzureBlobTraceListener" type="Microsoft.WindowsAzure.WebSites.Diagnostics.AzureBlobTraceListener, Microsoft.WindowsAzure.WebSites.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
          <add name="AzureDriveTraceListener" type="Microsoft.WindowsAzure.WebSites.Diagnostics.AzureDriveTraceListener, Microsoft.WindowsAzure.WebSites.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
        </sharedListeners>
        <sources>
          <source name="Microsoft.Owin" switchName="Microsoft.Owin" switchType="System.Diagnostics.SourceSwitch">
            <listeners>
              <add name="AzureTableTraceListener"/>
              <add name="AzureDriveTraceListener"/>
            </listeners>
          </source>
        </sources>
        <switches>
          <add name="Microsoft.Owin" value="All" />
        </switches>
        <trace autoflush="true" indentsize="4" />
      </system.diagnostics>
    
    0 讨论(0)
提交回复
热议问题