Azure Diagnostic Logging
In my Azure Lessons From the Trenches post I discussed using a logging library such as log4net for diagnostic logging. At the time, Azure’s logging capabilities weren’t very great.
With the release of the latest Azure SDK (November 2009), we now have the ability to use an Azure trace listener to perform basic logging to Azure Table Storage:
<system.diagnostics>
<trace>
<listeners>
<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener,
Microsoft.WindowsAzure.Diagnostics,
Version=1.0.0.0,
Culture=neutral,
PublicKeyToken=31bf3856ad364e35"
name="AzureDiagnostics">
<filter type="" />
</add>
</listeners>
</trace>
</system.diagnostics>
You can read more about configuring logs at Initializing and Configuring Diagnostic Data Sources in the Azure SDK. The above config XML fragment was taken from that Url.
Table storage is “cheap” in Azure (compared to SQL at least) - so this is a cost-effective way of writing diagnostic data. I put emphasis on diagnostic because this isn’t data you will really want to report on in SQL anyway. This is a fire-hose of informational data that can be easily retrieved or deleted through the Azure storage API.