WindowsEventLogsBufferConfiguration.ScheduledTransferLogLevelFilter Property
Gets or sets the logging level by which to filter records when performing a scheduled transfer.
Namespace: Microsoft.WindowsAzure.Diagnostics
Assembly: Microsoft.WindowsAzure.Diagnostics (in Microsoft.WindowsAzure.Diagnostics.dll)
Assembly: Microsoft.WindowsAzure.Diagnostics (in Microsoft.WindowsAzure.Diagnostics.dll)
/** @property */ /** @attribute CompilerGeneratedAttribute() */ public LogLevel get_ScheduledTransferLogLevelFilter () /** @property */ /** @attribute CompilerGeneratedAttribute() */ public void set_ScheduledTransferLogLevelFilter (LogLevel value)
CompilerGeneratedAttribute public function get ScheduledTransferLogLevelFilter () : LogLevel CompilerGeneratedAttribute public function set ScheduledTransferLogLevelFilter (value : LogLevel)
Property Value
Type: Microsoft.WindowsAzure.Diagnostics.LogLevelReturns LogLevel.The ScheduledTransferLogLevelFilter property is used to specify a LogLevel for Windows event logs. When you specify a LogLevel, all events greater than or equal to the specified severity are transferred to persistent storage. For example, if you specify LogLevel = Warning, Error and Critical logs will also be transferred to persistent storage.
When this property is set to Undefined, no filter is applied and all logging events at all levels are transferred.
Example
The following code snippet will transfer only error-level Windows event logs from local storage to persistent storage every minute.
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.WindowsEventLog.ScheduledTransferLogLevelFilter = LogLevel.Error;
// Schedule a transfer period of 30 minutes.
diagnosticConfiguration.WindowsEventLog.ScheduledTransferPeriod = TimeSpan.FromMinutes(30.0);
// Specify a buffer quota.
diagnosticConfiguration.WindowsEventLog.BufferQuotaInMB = 1024;
// Start the DiagnosticMonitor using the diagnosticConfig and our connection string.
DiagnosticMonitor.Start("Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString", diagnosticConfiguration);
return base.OnStart();
}
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 2008Target Platforms