GetDefaultInitialConfiguration Method
Dette innholdet er ikke tilgjengelig på ditt språk, men her er den engelske versjonen.

DiagnosticMonitor.GetDefaultInitialConfiguration Method ()


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()

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



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 .e4f3c96e-d9ad-4a9d-9c60-99b9bb09409a


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();


This API is not supported in Azure SDK versions 2.5 and higher. Instead, use the diagnostics.wadcfg XML configuration file. For more information, see Collect Logging Data by Using Azure Diagnostics.

Return to top
© 2015 Microsoft