Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

DiagnosticMonitor.GetDefaultInitialConfiguration Method

Updated: December 6, 2013

Returns the default initial diagnostic monitor configuration for the current role instance.

Namespace: Microsoft.WindowsAzure.Diagnostics
Assembly: Microsoft.WindowsAzure.Diagnostics (in Microsoft.WindowsAzure.Diagnostics.dll)

public static DiagnosticMonitorConfiguration GetDefaultInitialConfiguration ()

Return Value

Type: Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorConfiguration

A DiagnosticMonitorConfiguration with the default configuration.

The GetDefaultInitialConfiguration method returns a DiagnosticMonitorConfiguration object that specifies the default configuration for all logging and diagnostic buffers. When the initial configuration has been returned, you can modify its properties and use the updated configuration instead.

The default configuration is specified below:

Data Source Default Configuration Description


Enabled, stored locally, no transfer to persistent storage defined

Logs specific to the diagnostics infrastructure itself.


Enabled, stored locally, no transfer to persistent storage defined

Logs specific to Windows Azure.


1 minute

Checks every minute for diagnostics configuration changes in the diagnostics.wadcfg file located in wad-control-container. For more information on using this file, see Using the Windows Azure Diagnostics Configuration File.


wad-iis-failedreqlogfiles, wad-iis-logfiles, and wad-crash-dumps directories are specified by default, each with their DirectoryQuotaInMB property set to 1024MB.

These are the names of the storage containers where applicable log data will be transferred at the specified transfer interval.



4GB of local storage is allocated for the combined total of the logging sources. If you want to increase the overall quota beyond 4GB, you must make the changes in the ServiceConfiguration.cscfg file. Changing this property to a value larger than 4GB will not result in an increased quota. However, if you want to decrease the quota size, you can change the value of this property. For more information, see OverallQuotaInMB



No performance counters are specified in the default configuration.



No DataSources are specified for Windows Event logs.


The following ServiceConfiguration.cscfg snippet and WebRole.cs code snippet create a DiagnosticMonitorConfiguration object in a web role’s overridden OnStart method and adds a custom transfer interval.


  <Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" />


public class WebRole : RoleEntryPoint
    public override bool OnStart()
        // Create a new DiagnosticMonitorConfiguration object.
        DiagnosticMonitorConfiguration dmConfig = DiagnosticMonitor.GetDefaultInitialConfiguration();

        // Transfer the default log containers to a storage account every 30 minutes.
        dmConfig.Directories.ScheduledTransferPeriod = TimeSpan.FromMinutes(30.0);

        // Start the DiagnosticMonitor with the new DiagnosticMonitorConfiguration.
            DiagnosticMonitor.Start("Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString", dmConfig);
        catch (ArgumentException ae)
            // Handle any exceptions.
            System.Diagnostics.Trace.WriteLine(“Couldn’t start the DiagnosticMonitor.” + ae.Message);

        return base.OnStart();

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Development Platforms

Windows Vista, Windows 7, Windows Server 2008, Windows 8.1, Windows Server 2012 R2, Windows 8 and Windows Server 2012

Target Platforms

Community Additions

© 2015 Microsoft