Every role in a Windows Azure Service has a default implementation for starting the diagnostics. How to read the diagnostics was not directly clear to me.
By dumping the diagnostic logs to your storage service in set intervals they become available to read with a tool like Cloud Storage Studio, but also with Visual Studio 2010. The logs are dumped into a Azure Table and can be queried.
Below is a small peace of code that dumps the diagnostic logs every 15 seconds:
DiagnosticMonitorConfiguration config = DiagnosticMonitor.GetDefaultInitialConfiguration(); config.Logs.ScheduledTransferPeriod = TimeSpan.FromSeconds(15.0); DiagnosticMonitor.Start("DiagnosticsConnectionString", config);