This topic has not yet been rated - Rate this topic

DiagnosticMonitorConfiguration Class

Represents the configuration for a set of data buffers for logging and diagnostic information.

Namespace: Microsoft.WindowsAzure.Diagnostics
Assembly: Microsoft.WindowsAzure.Diagnostics (in Microsoft.WindowsAzure.Diagnostics.dll)
'Usage
Dim instance As DiagnosticMonitorConfiguration

public class DiagnosticMonitorConfiguration
public class DiagnosticMonitorConfiguration
public class DiagnosticMonitorConfiguration

The DiagnosticMonitorConfiguration class is used to store configured data buffers for each logging area in Windows Azure. In addition, you use it to specify how frequently to poll for changes to the diagnostics configuration, and to set the maximum amount of local storage to allocate for storing logs.

When you start a DiagnosticMonitor without providing a custom DiagnosticMonitorConfiguration, it will use the default configuration. The default configuration is identical to the configuration returned by calling GetDefaultInitialConfiguration, and is specified below:

Data Source Default Configuration Description

DiagnosticInfrastructureLogs

Enabled, stored locally, no transfer to persistent storage defined

Logs specific to the diagnostics infrastructure itself.

Logs

Enabled, stored locally, no transfer to persistent storage defined

Logs specific to Windows Azure.

ConfigurationChangePollInterval

1 minute

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

Directories

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.

OverallQuotaInMB

4,080MB

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

PerformanceCounters

Disabled

No performance counters are specified in the default configuration.

WindowsEventLog

Disabled

No DataSources are specified for Windows Event logs.

Alternatively, you can provide a customized DiagnosticMonitorConfiguration object as a parameter to the Start(String,DiagnosticMonitorConfiguration) method. The DiagnosticMonitor will then start using the new configuration instead of the default configuration.

Example

The following example gets a default configuration, specifies a customized diagnostic infrastructure logs data buffer, and starts the diagnostic monitor using the new configuration.

public override bool OnStart()
{
    // 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.DiagnosticInfrastructureLogs.ScheduledTransferLogLevelFilter = LogLevel.Error;

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

   // Specify a buffer quota.
   diagnosticConfiguration.DiagnosticInfrastructureLogs.BufferQuotaInMB = 1024;

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

   return base.OnStart();
}


System.Object
  Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorConfiguration
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 and Windows Server 2008

Target Platforms

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ