DiagnosticMonitorConfiguration Class
Assembly: Microsoft.WindowsAzure.Diagnostics (in Microsoft.WindowsAzure.Diagnostics.dll)
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 |
|---|---|---|
|
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 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. |
|
|
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 |
|
|
Disabled |
No performance counters are specified in the default configuration. |
|
|
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();
}
Development Platforms
Windows Vista, Windows 7 and Windows Server 2008Target Platforms