Search code examples
.netazureazure-storageazure-diagnostics

Azure Diagnositcs not storing data, even with default application


I am trying to store the azure diagnostics data on the storage account. I have tried the following code:

public override bool OnStart()
    {
        // For information on handling configuration changes
        // see the MSDN topic at http://go.microsoft.com/fwlink/?LinkId=166357.
        // Get the default initial configuration for DiagnosticMonitor.
        DiagnosticMonitorConfiguration diagnosticConfiguration = DiagnosticMonitor.GetDefaultInitialConfiguration();

        // Filter the logs so that only error-level logs are transferred to persistent storage.
        diagnosticConfiguration.Logs.ScheduledTransferLogLevelFilter = LogLevel.Information;

        // Schedule a transfer period of 30 minutes.
        diagnosticConfiguration.Logs.ScheduledTransferPeriod = TimeSpan.FromMinutes(1.0);

        // Specify a buffer quota of 1GB.
        diagnosticConfiguration.Logs.BufferQuotaInMB = 900;

        // Start the DiagnosticMonitor using the diagnosticConfig and our connection string.
        DiagnosticMonitor.Start("Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString", diagnosticConfiguration);

        Trace.TraceInformation("WebRole started");

        return base.OnStart();
    }

This code is same as microsoft has suggested on MSDN http://msdn.microsoft.com/en-us/library/windowsazure/microsoft.windowsazure.diagnostics.diagnosticmonitorconfiguration.logs

I have tried to comment out BufferQuotaInMB with no luck. I have tried this with newly created application both in local environment and on live deployment. Turns out that even WADLogsTable is not created.
What is it that i am missing?

Note: it is working alright on live deployment with windowsEventLogs.


Solution

  • Not sure what is wrong, as an alternative you could try using the Diagnostics.wadcfg as a config option in your code?

    Few blog posts explaining how to use it:

    How to use Diagnostics.wadcfg to configure Windows Azure diagnostics collection: http://www.davidaiken.com/2012/02/27/how-to-use-diagnostics-wadcfg-to-configure-windows-azure-diagnostics-collection/

    Configuring WAD via the diagnostics.wadcfg Config File: http://blogs.msdn.com/b/davidhardin/archive/2011/03/29/configuring-wad-via-the-diagnostics-wadcfg-config-file.aspx

    How to Use the Windows Azure Diagnostics Configuration File: http://msdn.microsoft.com/en-us/library/windowsazure/hh411551.aspx

    Worth a try, sorry I couldn't be of more help...