Exportar (0) Imprimir
Expandir Tudo

Propriedade DiagnosticMonitorConfiguration.Directories

[Este tópico é uma documentação de pré-lançamento e está sujeito a alterações em versões futuras. Os tópicos em branco são incluídos como espaços reservados.]

Gets or sets the buffer configuration for file-based logs, including custom logs.

Namespace: Microsoft.WindowsAzure.Diagnostics
Assembly: Microsoft.WindowsAzure.Diagnostics (em microsoft.windowsazure.diagnostics.dll)

'Uso
Dim instance As DiagnosticMonitorConfiguration
Dim value As DirectoriesBufferConfiguration

value = instance.Directories

instance.Directories = value

public DirectoriesBufferConfiguration Directories { get; set; }
/** @property */
/** @attribute CompilerGeneratedAttribute() */ 
public DirectoriesBufferConfiguration get_Directories ()

/** @property */
/** @attribute CompilerGeneratedAttribute() */ 
public void set_Directories (DirectoriesBufferConfiguration value)

CompilerGeneratedAttribute 
public function get Directories () : DirectoriesBufferConfiguration

CompilerGeneratedAttribute 
public function set Directories (value : DirectoriesBufferConfiguration)

Valor de propriedade

Returns DirectoriesBufferConfiguration.

The Directories property is used to specify the DirectoriesBufferConfiguration data buffer that is used for file-based logs. This property enables you to add one or more data sources to the DataSources collection, which is of type DirectoryConfiguration. You can also specify the default data buffer properties: BufferQuotaInMB and ScheduledTransferPeriod.

Example

The following code snippet creates a new diagnostic monitor configuration, specifies the directories configuration for file-based logs, and starts the diagnostic monitor using the new configuration.

public override bool OnStart()
{
    // Get the default initial configuration for DiagnosticMonitor.
    DiagnosticMonitorConfiguration diagnosticConfiguration = DiagnosticMonitor.GetDefaultInitialConfiguration();

    // Create a new DirectoryConfiguration object.
    DirectoryConfiguration directoryConfiguration = new DirectoryConfiguration();

    // Add the name for the blob container in Windows Azure storage.
    directoryConfiguration.Container = "wad-custom-logs";

    // Add the directory size quota for the blob container.
    directoryConfiguration.DirectoryQuotaInMB = 2048;

    // Add the log path in the role using RoleEnvironment.GetLocalResource().
    directoryConfiguration.Path = RoleEnvironment.GetLocalResource("LogsLocation").RootPath;

    // Add the directoryConfiguration to the Directories collection.
    diagnosticConfiguration.Directories.DataSources.Add(directoryConfiguration);

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

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

    return base.OnStart();
}


Todos os membros estáticos públicos (Compartilhados no Visual Basic) desse tipo são thread-safe. Quaisquer membros de instância não têm garantia de ser thread-safe.

Plataformas de desenvolvimento

Windows XP Professional com Service Pack 2 (SP2)

Plataformas de destino

Contribuições da comunidade

Mostrar:
© 2014 Microsoft