Azure Diagnostics - WADLogs Table not created

≯℡__Kan透↙ 提交于 2020-01-14 18:54:33

问题


I am trying to log the information whenever user perform some operations in a WebRole in cloud environment. In emulator it will write the info in output window, but in azue portal I cant see the info anywhere. I have enabled the azure diagnostics and provided the azure storage credentials, but the azure WADLogs table not getting created. This how I write the log "Trace.TraceInformation("Policy started");". Also used TraceSource to write the info to the log,but no luck.

Note: Iam using Azure SDk2.5

Please kindly guide me to proceed further.

Thanks, Suria.


回答1:


Please verify if you have the trace listener properly configured in your web.config or app.config. It should have Something like this -

<system.diagnostics>
<trace>
  <listeners>
    <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener,   Microsoft.WindowsAzure.Diagnostics, Version=2.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
      name="AzureDiagnostics">
      <filter type="" />
    </add>
  </listeners>
</trace>

Check your wadcfgx file to ensure you have the correct storage account in it under the element. Also check if the transfer of the Logs is enabled in the wadcfgx with appropriate transfer period /transfer filter.




回答2:


From the Azure SDK 2.5 release notes - "Diagnostics logs are not collected in the Azure compute emulator – For projects that target the Azure SDK version 2.5, the Azure compute emulator no longer supports the collection of diagnostics logs, including performance counters, infrastructure logs, IIS logs, and event logs. In addition, logs are no longer stored in Azure storage or development storage. You can continue to view application logs in the Visual Studio Output window or the compute emulator. This only affects projects that target Azure SDK version 2.5; projects that continue to target Azure SDK 2.4 are not affected."

So if you are running your app locally, you will not be able to see the logs or the table. But if you publish your app to Azure, you can view your logs by going to Server Explorer and looking under the StorageAccount where you configured your diagnostics output. Or you can right click on the Cloud Service instance on Server Explorer and select "View Diagnostics Data". This open up a page with a summary of your diagnostics data. These logs wont show up on the Azure portal but you can view them as described above through Visual Studio Server Explorer.



来源:https://stackoverflow.com/questions/27379505/azure-diagnostics-wadlogs-table-not-created

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!