WindowsEventLogsBufferConfiguration.DataSources Property
Gets or sets a list of configured data sources for Windows event logs.
Namespace: Microsoft.WindowsAzure.Diagnostics
Assembly: Microsoft.WindowsAzure.Diagnostics (in Microsoft.WindowsAzure.Diagnostics.dll)
Assembly: Microsoft.WindowsAzure.Diagnostics (in Microsoft.WindowsAzure.Diagnostics.dll)
The DataSources collection stores the list of Windows events to monitor. This property is used when retrieving or adding an event string to WindowsEventLog, as WindowsEventLog is of type WindowsEventLogsBufferConfiguration. For example, the following code snippet adds the Application!* event log string to the DataSources property of WindowsEventLogs:
// 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);
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