Wednesday, August 17, 2011

Windows Azure Accelerator for Web Roles Missing Trace Logging By Default

After upgrading our applications to Windows Azure Accelerator for Web Roles I found that the trace messages disappeared. Windows Azure Accelerator for Web Roles default project does not enable trace logging by default. To fix this simply add the following lines to the WebRole.cs of the Windows Azure Accelerator for Web Role project.

private static void ConfigureDiagnosticsMonitor()
{
//... Omitted from example
// Trace Logs
diagnosticMonitorConfiguration.Logs.ScheduledTransferLogLevelFilter = LogLevel.Undefined;
diagnosticMonitorConfiguration.Logs.ScheduledTransferPeriod = TimeSpan.FromMinutes(1);
//... Omitted from example
}