Open Diagnostics
With the above application, most and diagnostics-related work is now done for us . But be sure to remember that we have to add "Sharedlistener" to "Azurelocalstorage". It's really easy to do this task simply by swapping the annotated "system.diagnostics" node in the "Web.config" file of the WCF Web role.
In addition, you must add the following line of code to the "WebRole.cs" file:
Diagnosticmonitor.start (Cloudstorageaccount.developmentstorageaccount, diagnosticconfig);
During the process of migrating logs to blobstorage using SDK 1.3, you may experience problems that are related to the permissions available on the files that are created as svclog. This is not a solution, first of all, you can imitate robindotnet (specific can refer to: http://robindotnet.wordpress.com/2011/02/16/ azure-toolssdk-1-3-and-iis-logging/, or you can delete <Sites> nodes completely in "Servicedefinition.csdef", This means that it will no longer run as a full IIS. Now, if you can't resolve the known issues in this SDK 1.3, you can access them directly by browsing their file paths (using development emulator), or you can use Remote Desktop to access logs in the cloud.
If you're curious about the WCF tracking log that you can use immediately, you can open an affiliate project to see how it works for you--you can focus on the "Fixdiagfolderaccess.ps1" PowerShell script. It creates access control tables for this folder and, more importantly, creates a null or completely empty placeholder for the file (we'll rewrite the file eventually).
It can give you a definition of Svclog, which includes all the details of bindings and exceptions. Here you can find "DivideByZeroException" and start diagnosing the problem.
This file will first appear on your hard disk:
A few moments later, the Windows Azure diagnostics system migrates the file to the Wad-tracefiles container of the blob storage.
After that, this log can be downloaded to check for errors. In this example, we can scroll down until we find the details that are 0 apart, and then we'll find a red highlighted line showing an exception. To see more details, we can get the true stack trace of this error from the server.
The source code for this blog post can be downloaded from the following address:
Http://assets.bareweb.eu/wp-content/uploads/2011/03/WCFBasic.zip
Implementing and debugging a WCF service in Windows Azure (top) and implementing and debugging a WCF service in Windows Azure (medium)
Original name: Implementing and Debugging a WCF Service in Windows Azure Author: Andy
"This article is 51CTO selected translations, reproduced please indicate the source!" 】