Exportar (0) Imprimir
Expandir Tudo

Propriedade DiagnosticMonitorConfiguration.WindowsEventLog

[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 Windows event logs.

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

'Uso
Dim instance As DiagnosticMonitorConfiguration
Dim value As WindowsEventLogsBufferConfiguration

value = instance.WindowsEventLog

instance.WindowsEventLog = value

public WindowsEventLogsBufferConfiguration WindowsEventLog { get; set; }
/** @property */
/** @attribute CompilerGeneratedAttribute() */ 
public WindowsEventLogsBufferConfiguration get_WindowsEventLog ()

/** @property */
/** @attribute CompilerGeneratedAttribute() */ 
public void set_WindowsEventLog (WindowsEventLogsBufferConfiguration value)

CompilerGeneratedAttribute 
public function get WindowsEventLog () : WindowsEventLogsBufferConfiguration

CompilerGeneratedAttribute 
public function set WindowsEventLog (value : WindowsEventLogsBufferConfiguration)

Valor de propriedade

Returns WindowsEventLogsBufferConfiguration.

The WindowsEventLog property is used to specify the WindowsEventLogsBufferConfiguration data buffer that is used for logging Windows events. This property enables you to add event log sources to the DataSources collection for each event type you want to capture. You can also specify the ScheduledTransferLogLevelFilterLogLevel enumeration for setting the severity level of each log to transfer to persistent storage, and the default data buffer properties: DiagnosticDataBufferConfiguration and ScheduledTransferPeriod.

Example

The following code snippet creates a new diagnostic monitor configuration, specifies the configuration for Windows events, then starts the diagnostic monitor using the new configuration.

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

    // Add Application logs to the configuration.
    diagnosticConfiguration.WindowsEventLog.DataSources.Add("Application!*");

    // Filter the logs so that only error-level logs are transferred to persistent storage.
    diagnosticConfiguration.WindowsEventLog.ScheduledTransferLogLevelFilter = LogLevel.Error;

    // Schedule a transfer period of 30 minutes.
    diagnosticConfiguration.WindowsEventLog.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

A Microsoft está realizando uma pesquisa online para saber sua opinião sobre o site do MSDN. Se você optar por participar, a pesquisa online lhe será apresentada quando você sair do site do MSDN.

Deseja participar?
Mostrar:
© 2014 Microsoft