Экспорт (0) Печать
Развернуть все

Метод DiagnosticMonitor.GetDefaultInitialConfiguration

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

Пространство имен: Microsoft.WindowsAzure.Diagnostics
Сборка: Microsoft.WindowsAzure.Diagnostics (в microsoft.windowsazure.diagnostics.dll)

'Применение
Dim returnValue As DiagnosticMonitorConfiguration

returnValue = DiagnosticMonitor.GetDefaultInitialConfiguration

public static DiagnosticMonitorConfiguration GetDefaultInitialConfiguration ()
public static DiagnosticMonitorConfiguration GetDefaultInitialConfiguration ()
public static function GetDefaultInitialConfiguration () : DiagnosticMonitorConfiguration

Возвращаемое значение

Type: 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

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 located 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.

Example

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.

ServiceConfiguration.cscfg

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

WebRole.cs

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.
        try
        {
            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();
    }
}


Все открытые статические (Совместно используемая в Visual Basic) члены этого типа являются потокобезопасными. Потокобезопасность членов экземпляров не гарантируется.

Платформы разработки

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, Windows Server 2008 и Windows 2000

Целевые платформы

Добавления сообщества

Показ:
© 2014 Microsoft